CMS MADE SIMPLE FORGE

RSS2HTML

 

[#7957] Issue with Ampersands (&) in xml causing parse errors

avatar
Created By: Benoit Schumacher (benshu)
Date Submitted: 2012-05-14 11:39

Assigned To:
Resolution: None
State: Open
Summary:
Issue with Ampersands (&) in xml causing parse errors
Detailed Description:
There seems to be a problem in the parser when unencoded ampersands are present
in content.
This isn't necessarily a bug, but will surely help many if its patched in next
release.

What I have temporarily done that works for me is add the following in the
beginning of the MagpieRSS function in the rss_parse.inc file around line 104:

                        #FORMAT STRING INTO PURE HTML FIRST
			$newsource = trim(html_entity_decode($source));	
			#REPLACE HTML ENTITIES WITH HTML CODES
			$newsource = htmlentities($newsource, ENT_NOQUOTES);
			#REPLACE < & > HTML CODES WITH THE ACTUAL CHARACTERS
$newsource = str_replace(array("&lt;", "&gt;"), array("<", ">"), $newsource);
			$source = $newsource;

This stops getting the "Failed to parse RSS file." at line 238 in rss_fetch.inc
Error.

History