summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-12-01 06:23:01 +0100
committerAndrew Dolgov <[email protected]>2008-12-01 06:23:01 +0100
commit7cc1e4aed841c4ef3c197deaa3eb9844bce62c5d (patch)
tree44a3028f2ed9a57ef5bc116b0e142ae11f135531
parentc9d16c3ad2a48498abe51a62a89540c1e7c20fcf (diff)
magpie, simplepie: add (experimental) patches for broken libxml
-rw-r--r--magpierss/rss_parse.inc4
-rw-r--r--simplepie/simplepie.inc4
2 files changed, 8 insertions, 0 deletions
diff --git a/magpierss/rss_parse.inc b/magpierss/rss_parse.inc
index 3aff57a50..011048310 100644
--- a/magpierss/rss_parse.inc
+++ b/magpierss/rss_parse.inc
@@ -159,6 +159,10 @@ class MagpieRSS {
'feed_start_element', 'feed_end_element' );
xml_set_character_data_handler( $this->parser, 'feed_cdata' );
+
+ $source=str_replace("&lt;","&#60;",$source);
+ $source=str_replace("&gt;","&#62;",$source);
+ $source=str_replace("&amp;","&#38;",$source);
$status = xml_parse( $this->parser, $source );
diff --git a/simplepie/simplepie.inc b/simplepie/simplepie.inc
index 65c32abe6..cc3987c08 100644
--- a/simplepie/simplepie.inc
+++ b/simplepie/simplepie.inc
@@ -12761,6 +12761,10 @@ class SimplePie_Parser
xml_set_character_data_handler($xml, 'cdata');
xml_set_element_handler($xml, 'tag_open', 'tag_close');
+ $data=str_replace("&lt;","&#60;",$data);
+ $data=str_replace("&gt;","&#62;",$data);
+ $data=str_replace("&amp;","&#38;",$data);
+
// Parse!
if (!xml_parse($xml, $data, true))
{