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/api/ApiQueryImages.php | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'includes/api/ApiQueryImages.php') diff --git a/includes/api/ApiQueryImages.php b/includes/api/ApiQueryImages.php index 02fe24f1..69569e9b 100644 --- a/includes/api/ApiQueryImages.php +++ b/includes/api/ApiQueryImages.php @@ -82,9 +82,6 @@ class ApiQueryImages extends ApiQueryGeneratorBase { $res = $this->select(__METHOD__); if (is_null($resultPageSet)) { - - $data = array(); - $lastId = 0; // database has no ID 0 $count = 0; while ($row = $db->fetchObject($res)) { if (++$count > $params['limit']) { @@ -94,23 +91,16 @@ class ApiQueryImages extends ApiQueryGeneratorBase { '|' . $this->keyToTitle($row->il_to)); break; } - if ($lastId != $row->il_from) { - if($lastId != 0) { - $this->addPageSubItems($lastId, $data); - $data = array(); - } - $lastId = $row->il_from; - } - $vals = array(); ApiQueryBase :: addTitleInfo($vals, Title :: makeTitle(NS_FILE, $row->il_to)); - $data[] = $vals; - } - - if($lastId != 0) { - $this->addPageSubItems($lastId, $data); + $fit = $this->addPageSubItem($row->il_from, $vals); + if(!$fit) + { + $this->setContinueEnumParameter('continue', $row->il_from . + '|' . $this->keyToTitle($row->il_to)); + break; + } } - } else { $titles = array(); @@ -165,6 +155,6 @@ class ApiQueryImages extends ApiQueryGeneratorBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiQueryImages.php 44121 2008-12-01 17:14:30Z vyznev $'; + return __CLASS__ . ': $Id: ApiQueryImages.php 46845 2009-02-05 14:30:59Z catrope $'; } -} +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf