From: Tim Düsterhus Date: Tue, 17 Nov 2020 09:13:42 +0000 (+0100) Subject: Verify the existence of the old imagePath in update_com.woltlab.wcf_5.3_style.php X-Git-Tag: 5.3.1~30^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f7232db85f95ee10360a829919b365e57ded3da9;p=GitHub%2FWoltLab%2FWCF.git Verify the existence of the old imagePath in update_com.woltlab.wcf_5.3_style.php --- diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_style.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_style.php index e189837167..27fe4cfe2b 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_style.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_style.php @@ -55,20 +55,22 @@ foreach ($styleList as $style) { $srcPath = $assetBackupPath; } - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator( - $srcPath, - \FilesystemIterator::SKIP_DOTS - ), - \RecursiveIteratorIterator::SELF_FIRST - ); - foreach ($iterator as $file) { - /** @var \SplFileInfo $file */ - if (!$file->isFile()) continue; - - $relative = FileUtil::getRelativePath($srcPath, $file->getPath()); - FileUtil::makePath($style->getAssetPath() . $relative); - copy($file->getPathname(), $style->getAssetPath() . $relative . $file->getBasename()); + if (file_exists($srcPath)) { + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator( + $srcPath, + \FilesystemIterator::SKIP_DOTS + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + foreach ($iterator as $file) { + /** @var \SplFileInfo $file */ + if (!$file->isFile()) continue; + + $relative = FileUtil::getRelativePath($srcPath, $file->getPath()); + FileUtil::makePath($style->getAssetPath() . $relative); + copy($file->getPathname(), $style->getAssetPath() . $relative . $file->getBasename()); + } } } $styleEditor->update([