From 86185622aaa84ccda2c6da6f304dd599811cd795 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 18 Nov 2020 11:51:56 +0100 Subject: [PATCH] Add support for pending users to UserProfile::canSeeAvatar() --- wcfsetup/install/files/lib/data/user/UserProfile.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) + ); } /** -- 2.20.1