diff --git a/Classes/PHPExcel/Reader/Abstract.php b/Classes/PHPExcel/Reader/Abstract.php index 189c70a..deeb75a 100644 --- a/Classes/PHPExcel/Reader/Abstract.php +++ b/Classes/PHPExcel/Reader/Abstract.php @@ -269,6 +269,18 @@ abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader */ public function securityScan($xml) { + $pattern = '/encoding="(.*?)"/'; + $result = preg_match($pattern, $xml, $matches); + if ($result) { + $charset = $matches[1]; + } else { + $charset = 'UTF-8'; + } + + if ($charset !== 'UTF-8') { + $xml = mb_convert_encoding($xml, 'UTF-8', $charset); + } + $pattern = '/\\0?' . implode('\\0?', str_split('