Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed loading XML... error parsing attribute name attributes construct error Couldn't find end of Start Tag line 1 Extra content at the end of the document #6

Open
Stevec4 opened this issue May 22, 2016 · 0 comments

Comments

@Stevec4
Copy link

Stevec4 commented May 22, 2016

Was receiving this error.
Failed loading XML... error parsing attribute name attributes construct error Couldn't find end of Start Tag line 1 Extra content at the end of the document

I found that this was causing the error, some times extra spaces were being added and causing the above message.
<rss version="2.0"xmlns:atom="http://www.w3.org/2005/Atom">

To fix it I modified the helper file to clean up the url with a preg_replace there is probably a better way with regex but this was fast and worked out of the box for me.

helper.php about line 268

// cleanup the content received
            $repurl= array('<rss version="2.0"xmlns:atom="http://www.w3.org/2005/Atom">');
            $goodurl= array('<rss version="2.0"xmlns:atom="http://www.w3.org/2005/Atom">' =>'<rss version="2.0">');

            $fgcOutput = preg_replace("#(\n|\r|\s\s+|<!--(.*?)-->)#s", "", $fgcOutput);
            $fgcOutput = preg_replace("#(\t)#s", " ", $fgcOutput);

            $fgcOutput = str_replace($repurl, $goodurl, $fgcOutput);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant