From 382b51383c84fbb7f861fcd87b0b71b35c9f2869 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 26 Feb 2014 18:41:59 +0200 Subject: Don't use error suppression on is_dir(), file_exists() --- system/libraries/Zip.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'system/libraries/Zip.php') diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 40b661abc..43abfba42 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -133,12 +133,12 @@ class CI_Zip { protected function _get_mod_time($dir) { // filemtime() may return false, but raises an error for non-existing files - $date = file_exists($dir) ? @filemtime($dir) : getdate($this->now); + $date = file_exists($dir) ? filemtime($dir) : getdate($this->now); return array( - 'file_mtime' => ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2, - 'file_mdate' => (($date['year'] - 1980) << 9) + ($date['mon'] << 5) + $date['mday'] - ); + 'file_mtime' => ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2, + 'file_mdate' => (($date['year'] - 1980) << 9) + ($date['mon'] << 5) + $date['mday'] + ); } // -------------------------------------------------------------------- @@ -342,7 +342,7 @@ class CI_Zip { continue; } - if (@is_dir($path.$file)) + if (is_dir($path.$file)) { $this->read_dir($path.$file.DIRECTORY_SEPARATOR, $preserve_filepath, $root_path); } @@ -353,6 +353,7 @@ class CI_Zip { { $name = str_replace($root_path, '', $name); } + $this->add_data($name.$file, $data); } } -- cgit v1.2.3-24-g4f1b