From: Joshua Rüsweg Date: Mon, 9 Feb 2015 19:06:20 +0000 (+0100) Subject: make UserAvatarCondition::checkUser() work correctly X-Git-Tag: 2.1.0_RC_1~49^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c44738a963f256b35b05cd0bde8e8e6ea0b17038;p=GitHub%2FWoltLab%2FWCF.git make UserAvatarCondition::checkUser() work correctly atm the UserAvatarCondition is unusable, because it returns nonsense. The column ```avatar``` isn't provided by the database. And if the user has a gravatar the condition for NO_AVATAR returns ```true```, but actually the method should return ```false```. --- diff --git a/wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php b/wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php index 37af270788..f20fd00e0b 100644 --- a/wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php @@ -9,7 +9,7 @@ use wcf\system\WCF; * Condition implementation for the avatar of a user. * * @author Matthias Schmidt - * @copyright 2001-2014 WoltLab GmbH + * @copyright 2001-2015 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.condition @@ -69,11 +69,11 @@ class UserAvatarCondition extends AbstractSelectCondition implements IContentCon public function checkUser(Condition $condition, User $user) { switch ($condition->userAvatar) { case self::NO_AVATAR: - return !$user->avatar; + return !$user->avatarID && !$user->enableGravatar; break; case self::AVATAR: - return $user->avatar != 0; + return $user->avatarID != 0; break; case self::GRAVATAR: