Skip to content

An error occurred when deleting the cache file #418

@dadkhah-dev

Description

@dadkhah-dev

When multiple requests are sent to the server at the same time. The following error occurs.

Untitled

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions