Skip to content

Commit 127ee2f

Browse files
authored
Update Serializer.php (#443)
1 parent bdabc9b commit 127ee2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/HTMLPurifier/DefinitionCache/Serializer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ public function cleanup($config)
139139
continue;
140140
}
141141
$key = substr($filename, 0, strlen($filename) - 4);
142-
if ($this->isOld($key, $config)) {
143-
unlink($dir . '/' . $filename);
142+
$file = $dir . '/' . $filename;
143+
if ($this->isOld($key, $config) && file_exists($file)) {
144+
unlink($file);
144145
}
145146
}
146147
closedir($dh);

0 commit comments

Comments
 (0)