Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-6868

Double deleting the same file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.1
    • 3.0.x
    • Caching (ACM)
    • None
    • PHP Environment:
      Database:

      The problem is this function:

      	/**
      	* Removes/unlinks file
      	*/
      	function remove_file($filename)
      	{
      		if (!@unlink($filename))
      		{
      			// E_USER_ERROR - not using language entry - intended.
      			trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
      		}
      	}

      If the method is called twice in a short period of time to delete the same file, the error will be triggered because the file no longer exists. It would be better to check that the file still exists before throwing the error.

            Acyd Burn Meik Sievertsen [X] (Inactive)
            Marshalrusty Yuriy Rusko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: