From c3dc58a23d2dc25822daa9d5b9e28d114ae85a58 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 31 Mar 2021 11:16:59 +0200 Subject: [PATCH] Preview images and cover photos were exported twice --- wcfsetup/install/files/lib/data/style/StyleEditor.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index e8cc533f41..25cdd75360 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -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 -- 2.20.1