If `Style::$imagePath` is empty, it resulted in copying the shole WSC-folder into a style-asset-folder - and doing this until we reache the timeout limits.
Including `global.php` ended up in trying to define the option-constants (especially the fixed-value-options like `MODULE_ATTACHMENTS`) again while they are already defined - which causes a Fatal Error-Message.
<?php
-require('global.php');
use wcf\data\style\StyleEditor;
use wcf\data\style\StyleList;
// 3) If the file had a custom image folder we need to copy all files into the asset folder.
// Moving the files is unsafe, because multiple styles can share a single image folder.
- if ($style->imagePath != 'images/') {
- $srcPath = FileUtil::addTrailingSlash(WCF_DIR.$style->imagePath);
+ $srcPath = FileUtil::addTrailingSlash(WCF_DIR.$style->imagePath);
+ if ($srcPath !== WCF_DIR && $srcPath !== WCF_DIR.'images/') {
if ($srcPath == $style->getAssetPath()) {
$srcPath = FileUtil::removeTrailingSlash($style->getAssetPath()) . '.old53/';
}