From: umherirrender Date: Sat, 11 Jul 2015 10:19:35 +0000 (+0200) Subject: Use correct variable in UserCache::doQuery X-Git-Tag: 1.31.0-rc.0~10807 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=a0f83703cffe05e2044b63274f6ac636cdae247a;p=lhc%2Fweb%2Fwiklou.git 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 --- 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; } }