r56634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56633‎ | r56634 | r56635 >
Date:12:46, 19 September 2009
Author:happy-melon
Status:resolved (Comments)
Tags:
Comment:
Fix User::idFromName to actually return null on failure, as the doc suggests.
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -467,7 +467,7 @@
468468 $s = $dbr->selectRow( 'user', array( 'user_id' ), array( 'user_name' => $nt->getText() ), __METHOD__ );
469469
470470 if ( $s === false ) {
471 - $result = 0;
 471+ $result = null;
472472 } else {
473473 $result = $s->user_id;
474474 }
@@ -2151,7 +2151,7 @@
21522152 }
21532153 # Use strict parameter to avoid matching numeric 0 accidentally inserted
21542154 # by misconfiguration: 0 == 'foo'
2155 - return in_array( $action, $this->getRights(), true );
 2155+ return in_array( $action, $this->getRights(), true )
21562156 }
21572157
21582158 /**

Comments

#Comment by Happy-melon (talk | contribs)   12:51, 19 September 2009

That semicolon is replaced in r56635; I just made a hash of splitting up the commits... :(

Status & tagging log