From 1d44597743856584f52e4d64b807d2a384eacb05 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Mon, 17 Nov 2014 17:52:20 -0800 Subject: [PATCH] Avoid calling Title::makeTitleSafe in User::idFromName We don't want to call Title::makeTitleSafe yet, since that call path ends up needing the user language, which ends up trying to load the user object, which ends up back in User::idFromName. Bug: 54193 Change-Id: I05aacd30be66fe505b5c211113ea938fa82e2492 --- includes/User.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/User.php b/includes/User.php index 8fcdab26cf..f9f4b6a4bb 100644 --- a/includes/User.php +++ b/includes/User.php @@ -565,12 +565,10 @@ class User implements IDBAccessObject { * @return int|null The corresponding user's ID, or null if user is nonexistent */ public static function idFromName( $name ) { - $nt = Title::makeTitleSafe( NS_USER, $name ); - if ( is_null( $nt ) ) { - // Illegal name - return null; - } - + // We don't want to call Title::makeTitleSafe yet, since that call path + // ends up needing the user language, which ends up trying to load the + // user object, which ends up back here (bug 54193). + $nt = Title::makeTitle( NS_USER, $name ); if ( isset( self::$idCacheByName[$name] ) ) { return self::$idCacheByName[$name]; } -- 2.20.1