Preview images and cover photos were exported twice
authorMarcel Werk <burntime@woltlab.com>
Wed, 31 Mar 2021 09:16:59 +0000 (11:16 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 31 Mar 2021 09:16:59 +0000 (11:16 +0200)
wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index e8cc533f4146563c5ea89d3ed6d6f175779ab3d6..25cdd75360d03a86cf78581161f988a963b5b3e2 100644 (file)
@@ -916,7 +916,11 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                /** @var \SplFileInfo $file */
                                if (!$file->isFile()) continue;
                                if (!$regEx->match($file->getPathName())) continue;
-                               
+                               // Skip preview images and cover photos.
+                               if ($this->image && FileUtil::unifyDirSeparator($file->getPathname()) === FileUtil::unifyDirSeparator(WCF_DIR.'images/'.$this->image)) continue;
+                               if ($this->image2x && FileUtil::unifyDirSeparator($file->getPathname()) === FileUtil::unifyDirSeparator(WCF_DIR.'images/'.$this->image2x)) continue;
+                               if ($coverPhoto && FileUtil::unifyDirSeparator($file->getPathname()) === FileUtil::unifyDirSeparator($coverPhoto)) continue;
+
                                $imagesTar->add($file->getPathName(), '', $this->getAssetPath());
                        }
                        // append images tar to style tar