diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index 9b8eae0a7..7599d6188 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -352,7 +352,11 @@ class FileEngine extends CacheEngine { if (!$createKey && !$path->isFile()) { return false; } - if (empty($this->_File) || $this->_File->getBaseName() !== $key) { + if ( + empty($this->_File) || + $this->_File->getBaseName() !== $key || + $this->_File->valid() === false + ) { $exists = file_exists($path->getPathname()); try { $this->_File = $path->openFile('c+');