From a0f83703cffe05e2044b63274f6ac636cdae247a Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 11 Jul 2015 12:19:35 +0200 Subject: [PATCH] Use correct variable in UserCache::doQuery The variable $row is set to the last user of the first loop. It is better to use the $name which is set in the foreach correctly. This now adds all userpages to the LinkBatch and that avoids some extra queries on at least Special:ListFiles. Change-Id: Ied378b1596ec9d38eda41ce5ee413203c65eb21b --- includes/cache/UserCache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/cache/UserCache.php b/includes/cache/UserCache.php index 2a3aac2d19..51bf385b41 100644 --- a/includes/cache/UserCache.php +++ b/includes/cache/UserCache.php @@ -123,11 +123,11 @@ class UserCache { $lb = new LinkBatch(); foreach ( $usersToCheck as $userId => $name ) { if ( $this->queryNeeded( $userId, 'userpage', $options ) ) { - $lb->add( NS_USER, $row->user_name ); + $lb->add( NS_USER, $name ); $this->typesCached[$userId]['userpage'] = 1; } if ( $this->queryNeeded( $userId, 'usertalk', $options ) ) { - $lb->add( NS_USER_TALK, $row->user_name ); + $lb->add( NS_USER_TALK, $name ); $this->typesCached[$userId]['usertalk'] = 1; } } -- 2.20.1