Commit f5be82d0 authored by Christian Kuhn's avatar Christian Kuhn Committed by Benjamin Franzke

[BUGFIX] Suppress warning in SimpleFileBackend unlink()

Calling $cache->remove() on a simple file backend when
the file does not exist leads to a PHP warning.
Checking with file_exists() before could lead to race
conditions if some other process unlinks in between.
Solution is to simply suppress the unlink warning.

Resolves: #92847
Releases: master, 10.4
Change-Id: I3f3f44f73b89ff76939b891e8ca78c4d79369997
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67358Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
parent 71884c8f
......@@ -288,12 +288,7 @@ class SimpleFileBackend extends AbstractBackend implements PhpCapableBackendInte
if ($entryIdentifier === '') {
throw new \InvalidArgumentException('The specified entry identifier must not be empty.', 1334756961);
}
try {
unlink($this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension);
} catch (\Exception $e) {
return false;
}
return true;
return @unlink($this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment