Sleeky
Sleeky copied to clipboard
2.3.0 breaks yourls-api.php
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.
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.
The issue seems to have been solved with Sleeky 2.5.
Unfortunately, this doesn't address the problem with the backend that I reported, as the plugin is still at v2.4.1.
Oh. I'm sorry to hear. I've reopened the issue.