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
* @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];
}