From: Marcel Werk Date: Sun, 28 Mar 2021 12:13:50 +0000 (+0200) Subject: Delete trophy images when deleting tropies X-Git-Tag: 5.3.6~39 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c143158a639ca7befb187d209f87f48f594e1bbd;p=GitHub%2FWoltLab%2FWCF.git Delete trophy images when deleting tropies --- diff --git a/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php b/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php index cc38faae26..d745216d19 100644 --- a/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php +++ b/wcfsetup/install/files/lib/data/trophy/TrophyAction.class.php @@ -88,7 +88,13 @@ class TrophyAction extends AbstractDatabaseObjectAction implements IToggleAction $userTrophyAction = new UserTrophyAction($userTrophyList->getObjects(), 'delete'); $userTrophyAction->executeAction(); - + + foreach ($this->getObjects() as $trophy) { + if ($trophy->iconFile) { + @unlink(WCF_DIR . 'images/trophy/' . $trophy->iconFile); + } + } + $returnValues = parent::delete(); UserStorageHandler::getInstance()->resetAll('specialTrophies');