From: Alexandre Emsenhuber Date: Mon, 1 Mar 2010 21:07:04 +0000 (+0000) Subject: Per Simetrical's comment on r63048: use "$user instanceof User" so that it won't... X-Git-Tag: 1.31.0-rc.0~37573 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=877cf6219f8faf14edcff9759955c68187c34e19;p=lhc%2Fweb%2Fwiklou.git Per Simetrical's comment on r63048: use "$user instanceof User" so that it won't break whatever User::newFromName() returns on failure --- diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index f8d7ac357f..7e2a634015 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -410,7 +410,7 @@ class IPBlockForm { # Username block if( $wgSysopUserBans ) { $user = User::newFromName( $this->BlockAddress ); - if( $user !== false && $user->getId() ) { + if( $user instanceof User && $user->getId() ) { # Use canonical name $userId = $user->getId(); $this->BlockAddress = $user->getName();