r64860 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64859‎ | r64860 | r64861 >
Date:10:08, 10 April 2010
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
Fix yet another instance of comparing the result of User::newFromName to null
Modified paths:
  • /trunk/phase3/includes/specials/SpecialEmailuser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialEmailuser.php
@@ -303,7 +303,7 @@
304304 }
305305
306306 $nu = User::newFromName( $nt->getText() );
307 - if( is_null( $nu ) || !$nu->getId() ) {
 307+ if( !$nu instanceof Title || !$nu->getId() ) {
308308 wfDebug( "Target is invalid user.\n" );
309309 return "notarget";
310310 } else if ( !$nu->isEmailConfirmed() ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r648611.16wmf4: MFT r64860catrope10:09, 10 April 2010
r64862Fix epic fail in r64860catrope11:10, 10 April 2010
r65360MFT r63490, r64837, r64860, r64862: bug fixes for callers of User::newFromNam...tstarling09:30, 21 April 2010

Comments

#Comment by Happy-melon (talk | contribs)   10:52, 10 April 2010

Surely this needs to be instanceof User?? This seems to be breaking all emailuser calls, on enwiki at least.

Status & tagging log