diff options
author | Thomas Traub <thomastraub2000@yahoo.de> | 2011-11-04 14:16:43 +0100 |
---|---|---|
committer | Thomas Traub <thomastraub2000@yahoo.de> | 2011-11-04 14:16:43 +0100 |
commit | 29130086c3b8df146c8c599f5ba47038efa10faf (patch) | |
tree | 7c40be6a17a4808adf51038715baaaf2a62f7e78 | |
parent | 2a934c784aa1655b68d7c617914425b6bfe33b53 (diff) |
Add file exists check to prevent stat failed error warnings in the log
These occur when creating .zips by passing data and creating an artificial fs structure inside the .zip
-rw-r--r-- | system/libraries/Zip.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 9101eecb4..8e4357051 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -100,7 +100,7 @@ class CI_Zip { function _get_mod_time($dir) { // filemtime() will return false, but it does raise an error. - $date = (@filemtime($dir)) ? filemtime($dir) : getdate($this->now); + $date = (file_exists($dir) && @filemtime($dir)) ? filemtime($dir) : getdate($this->now); $time['file_mtime'] = ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2; $time['file_mdate'] = (($date['year'] - 1980) << 9) + ($date['mon'] << 5) + $date['mday']; |