From: Tim Düsterhus Date: Wed, 18 Nov 2020 10:51:56 +0000 (+0100) Subject: Add support for pending users to UserProfile::canSeeAvatar() X-Git-Tag: 5.4.0_Alpha_1~555^2~47^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=86185622aaa84ccda2c6da6f304dd599811cd795;p=GitHub%2FWoltLab%2FWCF.git Add support for pending users to UserProfile::canSeeAvatar() --- diff --git a/wcfsetup/install/files/lib/data/user/UserProfile.class.php b/wcfsetup/install/files/lib/data/user/UserProfile.class.php index cd0bf855cd..74df9bc3b4 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfile.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfile.class.php @@ -352,7 +352,11 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject { * @return boolean */ public function canSeeAvatar() { - return (WCF::getUser()->userID == $this->userID || WCF::getSession()->getPermission('user.profile.avatar.canSeeAvatars')); + return ( + WCF::getUser()->userID == $this->userID || + WCF::getSession()->getPermission('user.profile.avatar.canSeeAvatars') || + (($pending = WCF::getSession()->getPendingUserChange()) && $pending->userID == $this->userID) + ); } /**