From 0e268404d551022ed399012cd5b0d181522ee202 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 30 Nov 2013 01:57:58 +0100 Subject: [PATCH] UserArray: Avoid * and double keys in select Use User::selectFields to get all fields instead of *, also use array_unqiue to make the sql nicer by having only single value in the IN statement. Change-Id: I0a4888be20f84f2955e82ced621aed526cc83f20 --- includes/UserArray.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/UserArray.php b/includes/UserArray.php index 12b779e018..90d1134a51 100644 --- a/includes/UserArray.php +++ b/includes/UserArray.php @@ -47,8 +47,12 @@ abstract class UserArray implements Iterator { return new ArrayIterator( array() ); } $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'user', '*', array( 'user_id' => $ids ), - __METHOD__ ); + $res = $dbr->select( + 'user', + User::selectFields(), + array( 'user_id' => array_unique( $ids ) ), + __METHOD__ + ); return self::newFromResult( $res ); } -- 2.20.1