From 9ab79b988f9394b428215bb48f3153f168f03345 Mon Sep 17 00:00:00 2001 From: Mubashar Ahmad Date: Mon, 22 Aug 2022 21:13:20 +0500 Subject: [PATCH] no message --- src/Zip.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Zip.php b/src/Zip.php index 4c17697..2907fd0 100644 --- a/src/Zip.php +++ b/src/Zip.php @@ -2,8 +2,8 @@ namespace ZanySoft\Zip; -use \ZipArchive; -use \Exception; +use Exception; +use ZipArchive; /** * ZanySoft\Zip - ZipArchive toolbox @@ -633,7 +633,12 @@ private static function openZipFile($zip_file, $flags = null) { $zip = new ZipArchive(); - $open = $zip->open($zip_file, $flags); + if (is_null($flags)) { + $open = $zip->open($zip_file); + } else { + $open = $zip->open($zip_file, $flags); + } + if ($open !== true) { throw new \Exception(self::getStatus($open));