From 33e0a539b8b90ec8a667fda1ae31d1103b0ba460 Mon Sep 17 00:00:00 2001 From: "Alexia E. Smith" Date: Thu, 15 Mar 2018 10:24:21 -0500 Subject: [PATCH] Fix User::idFromName() ignoring cache for non-existent users. This fixes a database time out issue where User::idFromName() is repeatedly called from Special:Import due to the user not existing. The response is cached as null, but isset() will return false on a null key. Bug: T189786 Change-Id: I78705089a25dfec84d3c75bedaf623b1e5ee82c4 --- includes/user/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/user/User.php b/includes/user/User.php index ab791b4caa..d6523a7f3c 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -885,7 +885,7 @@ class User implements IDBAccessObject, UserIdentity { return null; } - if ( !( $flags & self::READ_LATEST ) && isset( self::$idCacheByName[$name] ) ) { + if ( !( $flags & self::READ_LATEST ) && array_key_exists( $name, self::$idCacheByName ) ) { return self::$idCacheByName[$name]; } -- 2.20.1