From 9bed2ebfa4e250a00794cdc75755f379dc17a696 Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Fri, 4 Dec 2020 11:05:10 +0100 Subject: [PATCH] Only rebuild favicons if there is a new image uploaded --- wcfsetup/install/files/lib/data/style/StyleAction.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/data/style/StyleAction.class.php b/wcfsetup/install/files/lib/data/style/StyleAction.class.php index ca31cf5239..820bd5f2ad 100644 --- a/wcfsetup/install/files/lib/data/style/StyleAction.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleAction.class.php @@ -322,7 +322,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction /** @var \wcf\system\file\upload\UploadFile $file */ $file = $this->parameters['uploads']['favicon']; - if ($file !== null) { + if ($file !== null && !$file->isProcessed()) { $fileLocation = $file->getLocation(); if (($imageData = getimagesize($fileLocation)) === false) { throw new \InvalidArgumentException('The given favicon is not an image'); @@ -356,7 +356,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction $file->setProcessed($newLocation); $hasFavicon = true; } - else { + else if ($file === null) { foreach ($images as $filename => $length) { unlink($style->getAssetPath().$filename); } -- 2.20.1