From 26ccac7f8c531fd5f62b5431c85a9f6d6f22924f Mon Sep 17 00:00:00 2001 From: kuba1999 Date: Mon, 27 Jun 2016 08:48:36 +0200 Subject: [PATCH] Fixed error when simplexml_load_string fails Fixed error "Call to a member function registerXPathNamespace() on boolean" when simplexml_load_string returns boolean. --- Classes/PHPExcel/Reader/Excel2007.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 1932df4b6..e95e9c826 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -1293,6 +1293,11 @@ public function load($pFilename) // Load VML comments file $relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); $vmlCommentsFile = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); + + if ($vmlCommentsFile == false) { + continue; + } + $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); $shapes = $vmlCommentsFile->xpath('//v:shape');