htmlpurifier
htmlpurifier copied to clipboard
An error occurred when deleting the cache file
When multiple requests are sent to the server at the same time. The following error occurs.
Why is it not checked that the file exists when the file is about to be deleted? Is it possible that an earlier process has deleted the file in processes that occur simultaneously?
while (false !== ($filename = readdir($dh))) {
if (empty($filename)) {
continue;
}
if ($filename[0] === '.') {
continue;
}
$key = substr($filename, 0, strlen($filename) - 4);
if ($this->isOld($key, $config)) {
unlink($dir . '/' . $filename);
}
}
Why package version 4.17 registered but cache file version is 4.15?
class HTMLPurifier_Config
{
/**
* HTML Purifier's version
* @type string
*/
public $version = '4.17.0';
}
Web server: nginx Php : 8.2 Package: "ezyang/htmlpurifier": "^4.17.0"
No error occurs when I make the following change.
public $version = '4.17.0'; ==============> public $version = '4.15.0';
Does anyone have an idea to fix this problem?