PHP8
authorAlan <alan@roojs.com>
Mon, 26 Feb 2024 02:54:50 +0000 (10:54 +0800)
committerAlan <alan@roojs.com>
Mon, 26 Feb 2024 02:54:50 +0000 (10:54 +0800)
XML/Parser.php

index 4040577..3a3285e 100644 (file)
@@ -370,7 +370,7 @@ class XML_Parser extends PEAR
             xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, $this->folding);
             return true;
         }
-        if (!in_array(strtoupper($this->srcenc), $this->_validEncodings)) {
+        if (!empty($this->srcenc) && !in_array(strtoupper($this->srcenc), $this->_validEncodings)) {
             return $this->raiseError('invalid source encoding', 
                 XML_PARSER_ERROR_INVALID_ENCODING);
         }