From: Tim Düsterhus Date: Fri, 24 Jul 2020 09:19:48 +0000 (+0200) Subject: DRY up handling of existing favicon in StyleEditForm X-Git-Tag: 5.3.0_Alpha_1~100^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6e7a5ef697ec4dfdcdd8347655a61b90496d7fb;p=GitHub%2FWoltLab%2FWCF.git DRY up handling of existing favicon in StyleEditForm Co-authored-by: Alexander Ebert --- diff --git a/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php index 9bf83bd51a..8e262b0afc 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php @@ -172,8 +172,9 @@ class StyleEditForm extends StyleAddForm { } if ($this->style->hasFavicon) { foreach (['png', 'jpg', 'gif'] as $extension) { - if (file_exists($this->style->getAssetPath()."favicon.template.".$extension)) { - $file = new UploadFile($this->style->getAssetPath()."favicon.template.".$extension, "favicon.template.".$extension, true, true, false); + $filename = "favicon.template.".$extension; + if (file_exists($this->style->getAssetPath().$filename)) { + $file = new UploadFile($this->style->getAssetPath().$filename, $filename, true, true, false); UploadHandler::getInstance()->registerFilesByField('favicon', [ $file, ]);