r63137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63136‎ | r63137 | r63138 >
Date:21:07, 1 March 2010
Author:ialex
Status:ok
Tags:
Comment:
Per Simetrical's comment on r63048: use "$user instanceof User" so that it won't break whatever User::newFromName() returns on failure
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -410,7 +410,7 @@
411411 # Username block
412412 if( $wgSysopUserBans ) {
413413 $user = User::newFromName( $this->BlockAddress );
414 - if( $user !== false && $user->getId() ) {
 414+ if( $user instanceof User && $user->getId() ) {
415415 # Use canonical name
416416 $userId = $user->getId();
417417 $this->BlockAddress = $user->getName();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63048* (bug 22666) Submitting user block form with an invalid user name no longer ...ialex15:24, 27 February 2010

Status & tagging log