SourceForge has been redesigned. Learn more.
Close

#497 Problem with RSS Feed reader

open
nobody
5
2012-10-11
2005-09-13
Anonymous
No

It appears that some valid RSS feeds will not display
when using the RssFeed plugin.
RssFeed calls /lib/RssParser.php which is an extension
of /libXmlParser.php

The problem seems to arise in XmlParser.php at abour
line 145 where the follwing code appears:

function parse_url($file, $debug=false) {
if (get_cfg_var('allow_url_fopen')) {
if (!($fp = fopen("$file","r"))) {
trigger_error("Error parse url $file");
return;
}
while ($data = fread($fp, 4096)) {
$this->parse($data, feof($fp));
}
fclose($fp);

If the 4096th character happens to fall in the middle
of an XML tag, say at the i in , the parser<br> loses its way.</p> <p>A solution that seems to work, although it may not be<br> the most elegant way of solving the problem is to<br> change this code to the following:</p> <p>function parse_url($file, $debug=false) {<br> if (get_cfg_var('allow_url_fopen')) {<br> if (!($fp = fopen("$file","r"))) {<br> trigger_error("Error parse url $file");<br> return;<br> }<br> while ($data = fread($fp, 4096)) { <br> //changes below made by JWN 9/12/05<br> //to prevent problem when the data divides<br> in the middle of a <tag><br> $data_collection .= $data; //++<br> //$this->parse($data, feof($fp)); //--<br> }<br> $this->parse($data_collection, feof($fp)); //++<br> fclose($fp);</p> <p>lines marked -- are deleted, lines marked ++ are added.</p>

Discussion


Log in to post a comment.