diff options
author | Christian Schneider | 2016-03-10 16:17:11 +0100 |
---|---|---|
committer | Christian Schneider | 2016-03-10 16:17:11 +0100 |
commit | 3ba223501a61a1bb607a529ce8023dd7b4478116 (patch) | |
tree | 17a33d33e2ce278baa9e4c360467ccc4c3fa46c0 /it_xml.class | |
parent | c58c8c2900026271907e46f5241abdc4f95bc033 (diff) | |
download | itools-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.class | 2 |
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 |