From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- includes/UserArray.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'includes/UserArray.php') diff --git a/includes/UserArray.php b/includes/UserArray.php index a2f54b7f..d48a4440 100644 --- a/includes/UserArray.php +++ b/includes/UserArray.php @@ -12,6 +12,17 @@ abstract class UserArray implements Iterator { return $userArray; } + static function newFromIDs( $ids ) { + $ids = array_map( 'intval', (array)$ids ); // paranoia + if ( !$ids ) + // Database::select() doesn't like empty arrays + return new ArrayIterator(array()); + $dbr = wfGetDB( DB_SLAVE ); + $res = $dbr->select( 'user', '*', array( 'user_id' => $ids ), + __METHOD__ ); + return self::newFromResult( $res ); + } + protected static function newFromResult_internal( $res ) { $userArray = new UserArrayFromResult( $res ); return $userArray; -- cgit v1.2.3-54-g00ecf