summaryrefslogtreecommitdiff
path: root/it_xml.class
diff options
context:
space:
mode:
authorChristian Schneider2016-03-10 16:17:11 +0100
committerChristian Schneider2016-03-10 16:17:11 +0100
commit3ba223501a61a1bb607a529ce8023dd7b4478116 (patch)
tree17a33d33e2ce278baa9e4c360467ccc4c3fa46c0 /it_xml.class
parentc58c8c2900026271907e46f5241abdc4f95bc033 (diff)
downloaditools-3ba223501a61a1bb607a529ce8023dd7b4478116.tar.gz
itools-3ba223501a61a1bb607a529ce8023dd7b4478116.tar.bz2
itools-3ba223501a61a1bb607a529ce8023dd7b4478116.zip
Accept both utf8 and utf-8 as xml encoding
Diffstat (limited to 'it_xml.class')
-rw-r--r--it_xml.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_xml.class b/it_xml.class
index 7584c1e..644ef9e 100644
--- a/it_xml.class
+++ b/it_xml.class
@@ -120,7 +120,7 @@ function _sanitize($xmldata, $isutf8 = null)
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;
- $isutf8 = (!preg_match('/^<\?xml[^>]* encoding=/i', $xmldata) || preg_match('/^<\?xml[^>]* encoding=.utf-8/i', $xmldata));
+ $isutf8 = (!preg_match('/^<\?xml[^>]* encoding=/i', $xmldata) || preg_match('/^<\?xml[^>]* encoding=.utf-?8/i', $xmldata));
}
# Decode illegal entities but protect semantically important ones