summaryrefslogtreecommitdiff
path: root/includes/api/ApiQueryImages.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiQueryImages.php')
-rw-r--r--includes/api/ApiQueryImages.php28
1 files changed, 9 insertions, 19 deletions
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