<instruction type="sql">update_5.3.sql</instruction>
</instructions>
- <!-- Run update_com.woltlab.wcf_5.3.1_style.php for 5.3.0 -> 5.3.1 -->
- <!-- Include `update_com.woltlab.wcf_5.3_orphanedComments.php` in the next update! -->
+ <!-- Run update_com.woltlab.wcf_5.3.2_style.php for 5.3.1 -> 5.3.2 -->
<!-- Add a note about the updated CSS in email_html.tpl to the release notes:
https://github.com/WoltLab/WCF/commit/1ac55ad408d5bfab4f69714c6259cc5d09ceb344
Administrators are highly encouraged to apply the CSS adjustments to their custom template version.
-->
- <instructions type="update" fromversion="5.3.0">
- <instruction type="acpTemplate">acptemplates_update.tar</instruction>
- <instruction type="file">files_update.tar</instruction>
- <instruction type="template">templates_update.tar</instruction>
-
- <instruction type="language" />
-
- <instruction type="option" />
-
- <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.3.1_style.php</instruction>
- <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.3_orphanedComments.php</instruction>
- </instructions>
</package>
+++ /dev/null
-<?php
-
-use wcf\data\style\StyleEditor;
-use wcf\data\style\StyleList;
-use wcf\util\FileUtil;
-
-/**
- * @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) {
- $styleEditor = new StyleEditor($style);
-
- // Fix the name of the favicon template.
- 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
- );
- }
- }
-
- // Fix the style preview.
- if (
- $style->image === basename($style->image) &&
- file_exists($style->getAssetPath() . $style->image)
- ) {
- $styleEditor->update([
- 'image' => FileUtil::getRelativePath(WCF_DIR.'images/', $style->getAssetPath()) . $style->image,
- ]);
- }
-
- if (
- $style->image2x === basename($style->image2x) &&
- file_exists($style->getAssetPath() . $style->image2x)
- ) {
- $styleEditor->update([
- 'image2x' => FileUtil::getRelativePath(WCF_DIR.'images/', $style->getAssetPath()) . $style->image2x,
- ]);
- }
-}
--- /dev/null
+<?php
+
+use wcf\data\style\StyleEditor;
+use wcf\data\style\StyleList;
+use wcf\util\FileUtil;
+
+/**
+ * @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) {
+ $styleEditor = new StyleEditor($style);
+
+ // Fix the style preview.
+ if (
+ $style->image === FileUtil::getRelativePath(WCF_DIR.'images/', $style->getAssetPath()) ||
+ !is_file($style->image)
+ ) {
+ $styleEditor->update([
+ 'image' => '',
+ ]);
+ }
+
+ if (
+ $style->image2x === FileUtil::getRelativePath(WCF_DIR.'images/', $style->getAssetPath()) ||
+ !is_file($style->image2x)
+ ) {
+ $styleEditor->update([
+ 'image2x' => '',
+ ]);
+ }
+}