From: Tim Düsterhus Date: Tue, 17 Nov 2020 14:25:44 +0000 (+0100) Subject: Fix typo in favicon template filename X-Git-Tag: 5.3.1~25^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=17271890d3678faa9ed452102a368176449dab7d;p=GitHub%2FWoltLab%2FWCF.git Fix typo in favicon template filename 5.2 used `favicon-template.ext` instead of `favicon.template.ext`. --- diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 04af14992e..ba1895d807 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -103,4 +103,5 @@ + diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3.1_faviconTemplate.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3.1_faviconTemplate.php new file mode 100644 index 0000000000..79465a3497 --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3.1_faviconTemplate.php @@ -0,0 +1,29 @@ + + * @package WoltLabSuite\Core + */ + +$styleList = new StyleList(); +$styleList->readObjects(); + +foreach ($styleList as $style) { + foreach ([ + 'gif', + 'jpeg', + 'jpg', + 'png', + ] as $extension) { + if (file_exists($style->getAssetPath() . 'favicon.template.' . $extension)) { + rename( + $style->getAssetPath() . 'favicon.template.' . $extension, + $style->getAssetPath() . 'favicon-template.' . $extension + ); + } + } +} diff --git a/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php index 8077990a5c..04225a5a9d 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php @@ -203,7 +203,7 @@ class StyleEditForm extends StyleAddForm { } if ($this->style->hasFavicon) { foreach (['png', 'jpg', 'gif'] as $extension) { - $filename = "favicon.template.".$extension; + $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', [ diff --git a/wcfsetup/install/files/lib/data/style/StyleAction.class.php b/wcfsetup/install/files/lib/data/style/StyleAction.class.php index 4bf7800b3a..c7b866ba44 100644 --- a/wcfsetup/install/files/lib/data/style/StyleAction.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleAction.class.php @@ -324,7 +324,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction throw new \InvalidArgumentException('The given favicon is not an image'); } $extension = ImageUtil::getExtensionByMimeType($imageData['mime']); - $newName = "favicon.template.".$extension; + $newName = "favicon-template.".$extension; $newLocation = $style->getAssetPath().$newName; rename($fileLocation, $newLocation); @@ -358,8 +358,8 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction } unlink($style->getAssetPath()."favicon.ico"); foreach (['png', 'jpg', 'gif'] as $extension) { - if (file_exists($style->getAssetPath()."favicon.template.".$extension)) { - unlink($style->getAssetPath()."favicon.template.".$extension); + if (file_exists($style->getAssetPath()."favicon-template.".$extension)) { + unlink($style->getAssetPath()."favicon-template.".$extension); } } (new StyleEditor($style))->update([