If you use simplepie to open http://video.google.com/?output=rss
thumbnails for videos that are not from youtube.com are not showing. For example at:
the first 6 entries are videos from youtube.com, and the rest are videos from dailymotion.com and video.google.com. For dailymotion.com and video.google.com 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
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
$url = 'http://video.google.com/videosearch?q=news&hl=en&qscrl=1&output=rss';
$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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
$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> | <?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 http://video.google.com/videosearch?q=news&hl=en&qscrl=1&output=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 http://vimeo.com/channels/staffpicks/videos/rss 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)
Update IRI percent-normalisation code.
Fixes a few tests, see https://gist.github.com/1187856 for before/after
Backport of 4e022de for one-dot-two. Fixes #108, fixes #112, maybe fixes #58.