Fix issue when removing the favicon of a style
authorMarcel Werk <burntime@woltlab.com>
Mon, 13 Nov 2023 16:41:41 +0000 (17:41 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 13 Nov 2023 16:41:41 +0000 (17:41 +0100)
wcfsetup/install/files/lib/data/style/StyleAction.class.php

index 9d3ca92fd5b019381225a96f4f0ee70a6990ba49..d02188115481a2e250ccde765f300b5d522f24b5 100644 (file)
@@ -363,7 +363,9 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction
                 }
             } else {
                 foreach ($images as $filename => $length) {
-                    \unlink($style->getAssetPath() . $filename);
+                    if (\file_exists($style->getAssetPath() . $filename)) {
+                        \unlink($style->getAssetPath() . $filename);
+                    }
                 }
                 if (\file_exists($style->getAssetPath() . "favicon.ico")) {
                     \unlink($style->getAssetPath() . "favicon.ico");