mirror of
https://github.com/mrclay/minify.git
synced 2025-08-12 09:05:08 +02:00
Corrupted cache files are now deleted.
This commit is contained in:
@@ -91,8 +91,13 @@ class Minify_Cache_File {
|
|||||||
*/
|
*/
|
||||||
private static function _verifiedWrite($file, $data)
|
private static function _verifiedWrite($file, $data)
|
||||||
{
|
{
|
||||||
return (file_put_contents($file, $data, LOCK_EX)
|
if (! @file_put_contents($file, $data, LOCK_EX)) {
|
||||||
&& (md5($data) === md5_file($file))
|
return false;
|
||||||
);
|
}
|
||||||
|
if (md5($data) !== md5_file($file)) {
|
||||||
|
@unlink($file);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user