summaryrefslogtreecommitdiff
path: root/it_xml.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_xml.class')
-rw-r--r--it_xml.class3
1 files changed, 3 insertions, 0 deletions
diff --git a/it_xml.class b/it_xml.class
index 654042b..6013b52 100644
--- a/it_xml.class
+++ b/it_xml.class
@@ -88,6 +88,9 @@ function from_xml($xmldata, $p)
if (!preg_match('/^(<\?xml|\xEF\xBB\xBF|\xFE\xFF|\xFF\xFE|\x00\x00\xFE\xFF|\x00\x00\xFF\xFE)/', $xmldata))
$xmldata = '<?xml version="1.0" encoding="' . $this->_p['encoding'] . '"?>' . $xmldata;
+ # decode illegal entities but protect semantically important ones
+ $xmldata = html_entity_decode(preg_replace('/&(amp|lt|gt|#38|#60|#62|#x26|#x3C|#3E);/i', '&amp;$1;', $xmldata));
+
$result = xml_parse($parser, $xmldata);
}