From: Alexander Ebert Date: Mon, 14 Nov 2022 11:53:45 +0000 (+0100) Subject: Replace `@\unlink()` with a check for file existence X-Git-Tag: 6.0.0_Alpha_1~727^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bdc65a3f166d2b17877ef2e60c0b477d8fbd034d;p=GitHub%2FWoltLab%2FWCF.git Replace `@\unlink()` with a check for file existence --- diff --git a/wcfsetup/install/files/lib/system/language/preload/command/ResetPreloadCache.class.php b/wcfsetup/install/files/lib/system/language/preload/command/ResetPreloadCache.class.php index dca2b48506..ecae59c7b0 100644 --- a/wcfsetup/install/files/lib/system/language/preload/command/ResetPreloadCache.class.php +++ b/wcfsetup/install/files/lib/system/language/preload/command/ResetPreloadCache.class.php @@ -25,6 +25,9 @@ final class ResetPreloadCache public function __invoke(): void { // Try to remove the file if it exists. - @\unlink(\WCF_DIR . $this->language->getPreloadCacheFilename()); + $filename = \WCF_DIR . $this->language->getPreloadCacheFilename(); + if (\file_exists($filename)) { + \unlink($filename); + } } }