From: Ori Livneh Date: Tue, 18 Nov 2014 01:52:20 +0000 (-0800) Subject: Avoid calling Title::makeTitleSafe in User::idFromName X-Git-Tag: 1.31.0-rc.0~13267 X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=commitdiff_plain;h=1d44597743856584f52e4d64b807d2a384eacb05;p=lhc%2Fweb%2Fwiklou.git 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 --- 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]; }