From cb394ce852f2f061d5d2f805cf4b2c1ccd4e6b48 Mon Sep 17 00:00:00 2001 From: Jeroen Seegers Date: Mon, 8 Jun 2015 15:08:44 +0200 Subject: [PATCH] Add default value for $contents in getFromName() --- Classes/PHPExcel/Shared/ZipArchive.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Shared/ZipArchive.php b/Classes/PHPExcel/Shared/ZipArchive.php index 806a2febd..76840b3b6 100644 --- a/Classes/PHPExcel/Shared/ZipArchive.php +++ b/Classes/PHPExcel/Shared/ZipArchive.php @@ -123,8 +123,9 @@ public function locateName($fileName) /** * Extract file from archive by given fileName (Emulate ZipArchive getFromName()) * - * @param string $fileName Filename for the file in zip archive - * @return string $contents File string contents + * @access public + * @param string $fileName Filename for the file in zip archive + * @return string $contents File string contents */ public function getFromName($fileName) { @@ -154,6 +155,8 @@ public function getFromName($fileName) } $extracted = $this->zip->extractByIndex($list_index, PCLZIP_OPT_EXTRACT_AS_STRING); } + + $contents = ""; if ((is_array($extracted)) && ($extracted != 0)) { $contents = $extracted[0]["content"]; }