From 362d93fea0b3d225dbc47cd1510aa0b1e82e8abd Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sat, 19 Sep 2009 12:46:51 +0000 Subject: [PATCH] Fix User::idFromName to actually return null on failure, as the doc suggests. --- includes/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/User.php b/includes/User.php index 995e6c153c..1f79998cb0 100644 --- a/includes/User.php +++ b/includes/User.php @@ -467,7 +467,7 @@ class User { $s = $dbr->selectRow( 'user', array( 'user_id' ), array( 'user_name' => $nt->getText() ), __METHOD__ ); if ( $s === false ) { - $result = 0; + $result = null; } else { $result = $s->user_id; } @@ -2151,7 +2151,7 @@ class User { } # Use strict parameter to avoid matching numeric 0 accidentally inserted # by misconfiguration: 0 == 'foo' - return in_array( $action, $this->getRights(), true ); + return in_array( $action, $this->getRights(), true ) } /** -- 2.20.1