From: joshuaruesweg Date: Fri, 4 Dec 2020 10:05:10 +0000 (+0100) Subject: Only rebuild favicons if there is a new image uploaded X-Git-Tag: 5.3.2~64 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bed2ebfa4e250a00794cdc75755f379dc17a696;p=GitHub%2FWoltLab%2FWCF.git Only rebuild favicons if there is a new image uploaded --- 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); }