Replace `@\unlink()` with a check for file existence
authorAlexander Ebert <ebert@woltlab.com>
Mon, 14 Nov 2022 11:53:45 +0000 (12:53 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 14 Nov 2022 11:53:45 +0000 (12:53 +0100)
wcfsetup/install/files/lib/system/language/preload/command/ResetPreloadCache.class.php

index dca2b48506ead174ba5364f525de434386f97b4e..ecae59c7b079552a0d7d3e01825c5b7ffa03f77a 100644 (file)
@@ -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);
+        }
     }
 }