]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/api/ApiQueryImages.php
MediaWiki 1.15.0
[autoinstallsdev/mediawiki.git] / includes / api / ApiQueryImages.php
index 02fe24f1f5a9e8f8d920fc690c73028485fa001f..69569e9bdfd77889a7f7380a7069640f5f56dc20 100644 (file)
@@ -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