summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-12-06 11:39:15 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-12-06 11:39:15 +0100
commitf9ff3afd28fbd5539a1081f25b83766369d78267 (patch)
treee67d80e721a4db80434c3dafb97d1868ae257743 /system/libraries
parent3cece7b27c965a9a6bc73d080f6df0a6ba681be0 (diff)
parentdba657efda6e057dc0c741dc449937c8ba5a029a (diff)
Merge pull request #647 from tomcode/patch-1
Zip class checks file exists to prevent error warnings in the log
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Zip.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 9101eecb4..52f1bc3d0 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -99,9 +99,9 @@ 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);
-
+ // filemtime() may return false, but raises an error for non-existing files
+ $date = (file_exists($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'];