Skip to content

Commit 4a7bd03

Browse files
committed
Adding a file_exists() check before unlinking cache files.
This prevents issues where two concurrent requests could be clearing the same cache files. Fixes #1936
1 parent 1a872e6 commit 4a7bd03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Cake/Cache/Engine/FileEngine.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ public function clear($check) {
240240
}
241241
$path = $this->_File->getRealPath();
242242
$this->_File = null;
243-
unlink($path);
243+
if (file_exists($path)) {
244+
unlink($path);
245+
}
244246
}
245247
$dir->close();
246248
return true;

0 commit comments

Comments
 (0)