Sleeky icon indicating copy to clipboard operation
Sleeky copied to clipboard

2.3.0 breaks yourls-api.php

Open karlemilnikka opened this issue 3 years ago • 4 comments

After upgrading to 2.3.0, yourls-api.php throws the following error instead of the “please login” response.

This page contains the following errors:
error on line 1 at column 75: XML declaration allowed only at the start of the document 

Version 2.2.1 and older is not affected. Deactivating Sleeky-backend or downgrading to version 2.2.1 solves the issue.

karlemilnikka avatar Apr 02 '21 23:04 karlemilnikka

I have a similar problem with version 2.4.1. With only Sleeky's backend installed, I get the following error when visiting yourls-api.php

XML Parsing Error: junk after document element
Location: https://my-domain.com/yourls-api.php
Line Number 1, Column 70:
		<style>ul#admin_menu li:not(.frontend_link) {display: none}</style><?xml version="1.0"?>
-----------------------------------------------------------------------------------^

As a temporary solution, I simply commented out the following section in /sleeky-backend/plugin.php

// Hide admin links for non-authenticated users.
if (yourls_is_valid_user() != 1) {
	echo <<<'HEAD'
		<style>ul#admin_menu li:not(.frontend_link) {display: none}</style>
HEAD;
}

Perhaps I'm mistaken, but I don't think Sleeky should touch the API at all. Just a suggestion.

s22-tech avatar Jun 15 '21 14:06 s22-tech

The issue seems to have been solved with Sleeky 2.5.

karlemilnikka avatar May 20 '22 20:05 karlemilnikka

Unfortunately, this doesn't address the problem with the backend that I reported, as the plugin is still at v2.4.1.

s22-tech avatar May 20 '22 21:05 s22-tech

Oh. I'm sorry to hear. I've reopened the issue.

karlemilnikka avatar May 21 '22 08:05 karlemilnikka