http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65360

Revision: 65360
Author:   tstarling
Date:     2010-04-21 09:30:38 +0000 (Wed, 21 Apr 2010)

Log Message:
-----------
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
    branches/REL1_16/phase3/includes/specials/SpecialEmailuser.php
    branches/REL1_16/phase3/includes/specials/SpecialUserlogin.php

Property Changed:
----------------
    branches/REL1_16/phase3/includes/specials/

Modified: branches/REL1_16/phase3/RELEASE-NOTES
===================================================================
--- branches/REL1_16/phase3/RELEASE-NOTES       2010-04-21 08:54:51 UTC (rev 
65359)
+++ branches/REL1_16/phase3/RELEASE-NOTES       2010-04-21 09:30:38 UTC (rev 
65360)
@@ -1,9 +1,7 @@
 = MediaWiki release notes =
 
-== MediaWiki 1.16 beta 2 ==
+== MediaWiki 1.16 beta 3 ==
 
-April 7, 2010
-
 This is a pre-release beta of the MediaWiki 1.16 branch.
 
 === Summary of selected changes in 1.16 ===
@@ -42,6 +40,11 @@
 you have the DBA extension for PHP installed, this will improve performance 
 further.
 
+== Changes since 1.16 beta 2 ==
+
+* Fixed bugs in the [[Special:Userlogin]] and [[Special:Emailuser]] handling of
+  invalid usernames.
+
 === Changes since 1.16 beta 1 ===
 
 * Fixed errors in maintenance/patchSql.php


Property changes on: branches/REL1_16/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
   - /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
   + /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

Modified: branches/REL1_16/phase3/includes/specials/SpecialEmailuser.php
===================================================================
--- branches/REL1_16/phase3/includes/specials/SpecialEmailuser.php      
2010-04-21 08:54:51 UTC (rev 65359)
+++ branches/REL1_16/phase3/includes/specials/SpecialEmailuser.php      
2010-04-21 09:30:38 UTC (rev 65360)
@@ -274,7 +274,7 @@
                }
        
                $nu = User::newFromName( $nt->getText() );
-               if( is_null( $nu ) || !$nu->getId() ) {
+               if( !$nu instanceof User || !$nu->getId() ) {
                        wfDebug( "Target is invalid user.\n" );
                        return "notarget";
                } else if ( !$nu->isEmailConfirmed() ) {

Modified: branches/REL1_16/phase3/includes/specials/SpecialUserlogin.php
===================================================================
--- branches/REL1_16/phase3/includes/specials/SpecialUserlogin.php      
2010-04-21 08:54:51 UTC (rev 65359)
+++ branches/REL1_16/phase3/includes/specials/SpecialUserlogin.php      
2010-04-21 09:30:38 UTC (rev 65360)
@@ -453,7 +453,7 @@
                # TODO: Allow some magic here for invalid external names, e.g., 
let the
                # user choose a different wiki name.
                $u = User::newFromName( $this->mName );
-               if( is_null( $u ) || !User::isUsableName( $u->getName() ) ) {
+               if( !( $u instanceof User ) || !User::isUsableName( 
$u->getName() ) ) {
                        return self::ILLEGAL;
                }
 
@@ -708,7 +708,7 @@
                        return;
                }
                $u = User::newFromName( $this->mName );
-               if( is_null( $u ) ) {
+               if( !$u instanceof User ) {
                        $this->mainLoginForm( wfMsg( 'noname' ) );
                        return;
                }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to