From: Alexander Ebert Date: Mon, 20 Sep 2021 12:17:50 +0000 (+0200) Subject: Skip the default cover photo when rebuilding users X-Git-Tag: 5.4.8_dev_1~24 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=07795ae179b187592e050308913be1666c21208a;p=GitHub%2FWoltLab%2FWCF.git Skip the default cover photo when rebuilding users Fixes #4500 --- diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index f991414682..eeb12f0d76 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -6,6 +6,7 @@ use wcf\data\reaction\type\ReactionTypeCache; use wcf\data\user\avatar\UserAvatar; use wcf\data\user\avatar\UserAvatarEditor; use wcf\data\user\avatar\UserAvatarList; +use wcf\data\user\cover\photo\DefaultUserCoverPhoto; use wcf\data\user\cover\photo\IWebpUserCoverPhoto; use wcf\data\user\User; use wcf\data\user\UserEditor; @@ -300,6 +301,11 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker foreach ($userProfiles as $userProfile) { $editor = new UserEditor($userProfile->getDecoratedObject()); $coverPhoto = $userProfile->getCoverPhoto(true); + if ($coverPhoto instanceof DefaultUserCoverPhoto) { + // The default cover photo can be returned if the user has a + // cover photo, but it has been disabled by an administrator. + continue; + } // If neither the regular, nor the WebP variant is readable then the // cover photo is missing and we must clear the database information.