From: Tim Düsterhus Date: Tue, 4 Aug 2020 14:57:48 +0000 (+0200) Subject: Duplicate logo on import of pageLogo = pageLogoMobile X-Git-Tag: 5.3.0_Alpha_1~99 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=35e3a1340511263c6f99410a8d6595d407059f3c;p=GitHub%2FWoltLab%2FWCF.git Duplicate logo on import of pageLogo = pageLogoMobile Fixes #3478 --- diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 166aeaa17c..7158e8781f 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -512,6 +512,13 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject } } + $duplicateLogo = false; + // duplicate logo if logo matches mobile logo + if (!empty($styleData['variables']['pageLogo']) && !empty($styleData['variables']['pageLogoMobile']) && $styleData['variables']['pageLogo'] == $styleData['variables']['pageLogoMobile']) { + $styleData['variables']['pageLogoMobile'] = 'm-'.basename($styleData['variables']['pageLogo']); + $duplicateLogo = true; + } + // save style if ($style === null) { $styleData['packageID'] = $packageID; @@ -584,6 +591,11 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject continue; } + // duplicate pageLogo for mobile version + if ($duplicateLogo && $val['filename'] == $styleData['variables']['pageLogo']) { + $imagesTar->extract($key, $style->getAssetPath().'m-'.basename($targetFile)); + } + $imagesTar->extract($key, $targetFile); FileUtil::makeWritable($targetFile); }