From 3ba223501a61a1bb607a529ce8023dd7b4478116 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 10 Mar 2016 16:17:11 +0100 Subject: Accept both utf8 and utf-8 as xml encoding --- it_xml.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = '_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 -- cgit v1.2.3