aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorumherirrender <umherirrender_de.wp@web.de>2013-11-30 01:57:58 +0100
committerIAlex <codereview@emsenhuber.ch>2013-12-14 14:51:42 +0000
commit0e268404d551022ed399012cd5b0d181522ee202 (patch)
tree5378fdb0bdb13ea9b2c1be8533ebd42ab0eb6445
parentd54e76a9b0a56ac0467482a263ce354fac86940a (diff)
downloadmediawikicore-0e268404d551022ed399012cd5b0d181522ee202.tar.gz
mediawikicore-0e268404d551022ed399012cd5b0d181522ee202.zip
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
-rw-r--r--includes/UserArray.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/UserArray.php b/includes/UserArray.php
index 12b779e018db..90d1134a51b7 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 );
}