mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-30 20:18:00 +00:00
case-insensitive charset name in xml scanner
This commit is contained in:
@@ -100,7 +100,7 @@ class XmlScanner
|
||||
$xml = mb_convert_encoding($xml, 'UTF-8', $charset);
|
||||
|
||||
$result = preg_match($pattern, $xml, $matches);
|
||||
$charset = $result ? $matches[1] : 'UTF-8';
|
||||
$charset = strtoupper($result ? $matches[1] : 'UTF-8');
|
||||
if ($charset !== 'UTF-8') {
|
||||
throw new Reader\Exception('Suspicious Double-encoded XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user