From a6e7a5ef697ec4dfdcdd8347655a61b90496d7fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 24 Jul 2020 11:19:48 +0200 Subject: [PATCH] DRY up handling of existing favicon in StyleEditForm Co-authored-by: Alexander Ebert --- wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, ]); -- 2.20.1