r65360 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65359‎ | r65360 | r65361 >
Date:09:30, 21 April 2010
Author:tstarling
Status:ok
Tags:
Comment:
MFT r63490, r64837, r64860, r64862: bug fixes for callers of User::newFromName(), inappropriately comparing return value to null.
Modified paths:
  • /branches/REL1_16/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_16/phase3/includes/specials (modified) (history)
  • /branches/REL1_16/phase3/includes/specials/SpecialEmailuser.php (modified) (history)
  • /branches/REL1_16/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: branches/REL1_16/phase3/includes/specials/SpecialUserlogin.php
@@ -453,7 +453,7 @@
454454 # TODO: Allow some magic here for invalid external names, e.g., let the
455455 # user choose a different wiki name.
456456 $u = User::newFromName( $this->mName );
457 - if( is_null( $u ) || !User::isUsableName( $u->getName() ) ) {
 457+ if( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
458458 return self::ILLEGAL;
459459 }
460460
@@ -708,7 +708,7 @@
709709 return;
710710 }
711711 $u = User::newFromName( $this->mName );
712 - if( is_null( $u ) ) {
 712+ if( !$u instanceof User ) {
713713 $this->mainLoginForm( wfMsg( 'noname' ) );
714714 return;
715715 }
Index: branches/REL1_16/phase3/includes/specials/SpecialEmailuser.php
@@ -274,7 +274,7 @@
275275 }
276276
277277 $nu = User::newFromName( $nt->getText() );
278 - if( is_null( $nu ) || !$nu->getId() ) {
 278+ if( !$nu instanceof User || !$nu->getId() ) {
279279 wfDebug( "Target is invalid user.\n" );
280280 return "notarget";
281281 } else if ( !$nu->isEmailConfirmed() ) {
Property changes on: branches/REL1_16/phase3/includes/specials
___________________________________________________________________
Name: svn:mergeinfo
282282 - /branches/REL1_15/phase3/includes/specials:51646
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381,56967
/trunk/phase3/includes/specials:63045,63047,63549,63764,63897-63901
283283 + /branches/REL1_15/phase3/includes/specials:51646
/branches/sqlite/includes/specials:58211-58321
/branches/wmf-deployment/includes/specials:53381,56967
/trunk/phase3/includes/specials:63045,63047,63490,63549,63764,63897-63901,64837,64860,64862
Index: branches/REL1_16/phase3/RELEASE-NOTES
@@ -1,9 +1,7 @@
22 = MediaWiki release notes =
33
4 -== MediaWiki 1.16 beta 2 ==
 4+== MediaWiki 1.16 beta 3 ==
55
6 -April 7, 2010
7 -
86 This is a pre-release beta of the MediaWiki 1.16 branch.
97
108 === Summary of selected changes in 1.16 ===
@@ -42,6 +40,11 @@
4341 you have the DBA extension for PHP installed, this will improve performance
4442 further.
4543
 44+== Changes since 1.16 beta 2 ==
 45+
 46+* Fixed bugs in the [[Special:Userlogin]] and [[Special:Emailuser]] handling of
 47+ invalid usernames.
 48+
4649 === Changes since 1.16 beta 1 ===
4750
4851 * Fixed errors in maintenance/patchSql.php

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63490Avoid fatal on login if username is invalid title...simetrical19:27, 9 March 2010
r64837Fix another instance of the result of User::newFromName() being compared with...catrope22:12, 9 April 2010
r64860Fix yet another instance of comparing the result of User::newFromName to nullcatrope10:08, 10 April 2010
r64862Fix epic fail in r64860catrope11:10, 10 April 2010

Status & tagging log