summaryrefslogtreecommitdiff
path: root/includes/api/ApiQueryExternalLinks.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/api/ApiQueryExternalLinks.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/api/ApiQueryExternalLinks.php')
-rw-r--r--includes/api/ApiQueryExternalLinks.php26
1 files changed, 8 insertions, 18 deletions
diff --git a/includes/api/ApiQueryExternalLinks.php b/includes/api/ApiQueryExternalLinks.php
index a24f15d8..7a91f432 100644
--- a/includes/api/ApiQueryExternalLinks.php
+++ b/includes/api/ApiQueryExternalLinks.php
@@ -61,8 +61,6 @@ class ApiQueryExternalLinks extends ApiQueryBase {
$db = $this->getDB();
$res = $this->select(__METHOD__);
- $data = array();
- $lastId = 0; // database has no ID 0
$count = 0;
while ($row = $db->fetchObject($res)) {
if (++$count > $params['limit']) {
@@ -71,23 +69,15 @@ class ApiQueryExternalLinks extends ApiQueryBase {
$this->setContinueEnumParameter('offset', @$params['offset'] + $params['limit']);
break;
}
- if ($lastId != $row->el_from) {
- if($lastId != 0) {
- $this->addPageSubItems($lastId, $data);
- $data = array();
- }
- $lastId = $row->el_from;
- }
-
$entry = array();
ApiResult :: setContent($entry, $row->el_to);
- $data[] = $entry;
- }
-
- if($lastId != 0) {
- $this->addPageSubItems($lastId, $data);
+ $fit = $this->addPageSubItem($row->el_from, $entry);
+ if(!$fit)
+ {
+ $this->setContinueEnumParameter('offset', @$params['offset'] + $count - 1);
+ break;
+ }
}
-
$db->freeResult($res);
}
@@ -123,6 +113,6 @@ class ApiQueryExternalLinks extends ApiQueryBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryExternalLinks.php 37270 2008-07-07 17:32:22Z catrope $';
+ return __CLASS__ . ': $Id: ApiQueryExternalLinks.php 46845 2009-02-05 14:30:59Z catrope $';
}
-}
+} \ No newline at end of file