diff options
author | Andrey Andreev <narf@devilix.net> | 2014-02-26 17:41:59 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-02-26 17:41:59 +0100 |
commit | 382b51383c84fbb7f861fcd87b0b71b35c9f2869 (patch) | |
tree | 9aa8bf35189e3a7f4a8a6923bafba758d15aa90b /system/libraries | |
parent | ea41c8aa1951216b6a9ccc99832d69d2b41c5ead (diff) |
Don't use error suppression on is_dir(), file_exists()
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Ftp.php | 4 | ||||
-rw-r--r-- | system/libraries/Upload.php | 2 | ||||
-rw-r--r-- | system/libraries/Zip.php | 11 |
3 files changed, 10 insertions, 7 deletions
diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index fc02f8300..8401a380e 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -147,6 +147,7 @@ class CI_FTP { { $this->_error('ftp_unable_to_connect'); } + return FALSE; } @@ -156,6 +157,7 @@ class CI_FTP { { $this->_error('ftp_unable_to_login'); } + return FALSE; } @@ -572,7 +574,7 @@ class CI_FTP { // Recursively read the local directory while (FALSE !== ($file = readdir($fp))) { - if (@is_dir($locpath.$file) && $file[0] !== '.') + if (is_dir($locpath.$file) && $file[0] !== '.') { $this->mirror($locpath.$file.'/', $rempath.$file.'/'); } diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 62cfb28c0..75fc0624f 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -972,7 +972,7 @@ class CI_Upload { $this->upload_path = str_replace('\\', '/', realpath($this->upload_path)); } - if ( ! @is_dir($this->upload_path)) + if ( ! is_dir($this->upload_path)) { $this->set_error('upload_no_filepath'); return FALSE; 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); } } |