5.2 used `favicon-template.ext` instead of `favicon.template.ext`.
</instructions>
<!-- Run the option.xml update for 5.3.0 -> 5.3.1, due to the missing removal of external_link_rel_nofollow. -->
+ <!-- Run update_com.woltlab.wcf_5.3.1_faviconTemplate.php for 5.3.0 -> 5.3.1 -->
</package>
--- /dev/null
+<?php
+
+use wcf\data\style\StyleList;
+
+/**
+ * @author Tim Duesterhus
+ * @copyright 2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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
+ );
+ }
+ }
+}
}
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', [
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);
}
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([