summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/IXR_Library.php6
-rw-r--r--inc/SimplePie.php7
2 files changed, 13 insertions, 0 deletions
diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php
index fb11585ca..ae77f2c27 100644
--- a/inc/IXR_Library.php
+++ b/inc/IXR_Library.php
@@ -144,6 +144,12 @@ class IXR_Message {
function parse() {
// first remove the XML declaration
$this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);
+ // workaround for a bug in PHP/libxml2, see http://bugs.php.net/bug.php?id=45996
+ $this->message = str_replace('&lt;', '&#60;', $this->message);
+ $this->message = str_replace('&gt;', '&#62;', $this->message);
+ $this->message = str_replace('&amp;', '&#38;', $this->message);
+ $this->message = str_replace('&apos;', '&#39;', $this->message);
+ $this->message = str_replace('&quot;', '&#34;', $this->message);
if (trim($this->message) == '') {
return false;
}
diff --git a/inc/SimplePie.php b/inc/SimplePie.php
index 390b7e0a0..b5dab727f 100644
--- a/inc/SimplePie.php
+++ b/inc/SimplePie.php
@@ -10297,6 +10297,13 @@ class SimplePie_Parser
xml_set_character_data_handler($this->xml, 'cdata');
xml_set_element_handler($this->xml, 'tag_open', 'tag_close');
+ // workound for a bug in PHP/libxml2 as described on http://bugs.simplepie.org/issues/show/101
+ $data = str_replace('&lt;', '&#60;', $data);
+ $data = str_replace('&gt;', '&#62;', $data);
+ $data = str_replace('&amp;', '&#38;', $data);
+ $data = str_replace('&apos;', '&#39;', $data);
+ $data = str_replace('&quot;', '&#34;', $data);
+
// Parse!
if (!xml_parse($this->xml, $data, true))
{