Skip to content

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

@Stevec4

Description

@Stevec4

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions