diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php index fb11585ca9b5d0ffa5d195fe47b5f45e4d92c964..ae77f2c27833dfeeff272282c01d69b2913bc38b 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('<', '<', $this->message); + $this->message = str_replace('>', '>', $this->message); + $this->message = str_replace('&', '&', $this->message); + $this->message = str_replace(''', ''', $this->message); + $this->message = str_replace('"', '"', $this->message); if (trim($this->message) == '') { return false; } diff --git a/inc/SimplePie.php b/inc/SimplePie.php index 390b7e0a0cc48a4f683213cb8ed39a4d0cabbffd..b5dab727f308618a29a56dde2eb661741e83190b 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('<', '<', $data); + $data = str_replace('>', '>', $data); + $data = str_replace('&', '&', $data); + $data = str_replace(''', ''', $data); + $data = str_replace('"', '"', $data); + // Parse! if (!xml_parse($this->xml, $data, true)) {