diff --git a/framework/caching/FileCache.php b/framework/caching/FileCache.php index aaa5049fef9..f79c7deaddc 100644 --- a/framework/caching/FileCache.php +++ b/framework/caching/FileCache.php @@ -97,7 +97,7 @@ public function exists($key) { $cacheFile = $this->getCacheFile($this->buildKey($key)); - return @filemtime($cacheFile) > time(); + return file_exists($cacheFile) && @filemtime($cacheFile) > time(); } /** @@ -110,7 +110,7 @@ protected function getValue($key) { $cacheFile = $this->getCacheFile($key); - if (@filemtime($cacheFile) > time()) { + if (file_exists($cacheFile) && @filemtime($cacheFile) > time()) { $fp = @fopen($cacheFile, 'r'); if ($fp !== false) { @flock($fp, LOCK_SH);