Maintain `hasFavicon` attribute during style import
authorjoshuaruesweg <ruesweg@woltlab.com>
Tue, 14 Dec 2021 09:50:40 +0000 (10:50 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Tue, 14 Dec 2021 09:50:40 +0000 (10:50 +0100)
wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index 5f80dcd63bdbaa0de89e6fc74025ce1e0f548408..eb1a03c47d82612a7ee8cf863bad33d04a128568 100644 (file)
@@ -706,6 +706,12 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
 
                         $imagesTar->extract($key, $targetFile);
                         FileUtil::makeWritable($targetFile);
+
+                        if (\preg_match('/^favicon\-template\.(png|jpg|gif)$/', \basename($targetFile))) {
+                            $style->update([
+                                'hasFavicon' => 1,
+                            ]);
+                        }
                     }
                 }