From 405c1c356c15633e070ca0dc6bf5bde6f436d201 Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Thu, 27 Dec 2007 17:04:17 +0000 Subject: [PATCH] 'Special-case optimization' seems to be already included in User::getId, in a smarter way; it shouldn't be done in User::isLoggedIn too. --- includes/SpecialUserrights.php | 2 +- includes/User.php | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index c5ab9655ba..a2d78c7096 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -208,7 +208,7 @@ class UserrightsForm extends HTMLForm { $user = UserRightsProxy::newFromName( $database, $name ); } - if( !$user || $user->getId() == 0 ) { + if( !$user || $user->isAnon() ) { $wgOut->addWikiText( wfMsg( 'nosuchusershort', wfEscapeWikiText( $username ) ) ); return null; } diff --git a/includes/User.php b/includes/User.php index c22ed5fe9d..756355a3d6 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1729,13 +1729,8 @@ class User { * Returns true if the user is not an anonymous visitor. * * @return bool - * @fixme "special-case optimization" may fail for an object referring to a user that doesn't exist in the system. */ function isLoggedIn() { - if( $this->mId === null and $this->mName !== null ) { - // Special-case optimization - return !self::isIP( $this->mName ); - } return $this->getID() != 0; } -- 2.20.1