Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Loading… #58

peters55 opened this Issue · 10 comments

4 participants


If you use simplepie to open
thumbnails for videos that are not from are not showing. For example at:

the first 6 entries are videos from, and the rest are videos from and For and entries thumbnails are not showing. The image location url for the thumbnail is wrong:


it should be:



Is this specific to this feed only?


I haven't tested other feeds for this particular bug. But this might happen with other feeds, if they have image urls containing "id=" (or "id"). I'm not sure what is the reason for this bug. Do you have any suggestions how to fix this, or what might cause this? We might be able to help fixing this or provide feedback, if you can point possible reasons for this bug.


I'm trying to get it down to a specific test case. At a guess, it's something weird with the XML parser.


I cannot locate the reason for this bug.


The problem appears to be in the lines 13541ff of v1.1.3

            if ($this->strip_attributes)
                foreach ($this->strip_attributes as $attrib)
                    $data = preg_replace('/(<[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*)' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . trim($attrib) . '(?:\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>/', '\1\2\3>', $data);

because if I remove this section the problem disappears


Version 1.1.3 is no longer supported. Can you reproduce this with 1.2 or 1.3-dev?


Using the following simplepietest.php

require '/home/myaccount/wp-content/plugins/simplepie-core/';

$url = '';
$stupidly_fast = false;
$max = 0;
$feed = new SimplePie();
$feed->enable_order_by_date(false); // thanks Julian Popov
$feed->set_useragent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)');

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SimplePie Test</title>

            <h1>SimplePie Test</h1>
                $channel = $feed->get_feed_tags('', 'channel');
                // loop through items
                foreach ($feed->get_items() as $item):
                <li><a href="<?php echo $item->get_link(); ?>"><?php echo $item->get_title(); ?></a>&nbsp;|&nbsp;<?php echo $item->get_date('j F Y'); ?><br /><?php echo $item->get_description(); ?></li>
            <?php endforeach; ?>

if I try this with 1.2-dev and 1.3-dev all I get is the title printed 'SimplePie Test' with the Google Search rss as above.

SimplePie gives the error This XML document is invalid, likely due to invalid characters. XML error: XML_ERR_NAME_REQUIRED at line 1, column 2

This feed was no problem in 1.1.3.

So I can't test the original problem.

If I use another feed eg then it works fine.


Can anyone confirm this bug still exists in 1.2.1-dev?


I downloaded 1.2.1 and the problem still exist. I'm using an older version of SimplePie 1.0 and it works fine on that example. I'm also bumping into another bug not sure if it falls into the same category

if you try to get this feed it'll shoot back an error. The old version worked fine.


Just checked on 1.2.1-dev that I have locally. What does SimplePie_Misc::debug($sp) give? (Where $sp is your instance of SimplePie)

@rmccue rmccue closed this issue from a commit
@rmccue rmccue Update IRI percent-normalisation code.
Fixes a few tests, see for before/after

Backport of 4e022de for one-dot-two. Fixes #108, fixes #112, maybe fixes #58.
@rmccue rmccue closed this in 76b5fd6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.