diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 13:00:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 13:00:47 +0200 |
commit | 72e90545454c0e014318fa3c81658e035aac58c1 (patch) | |
tree | 9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/api/ApiQueryLangLinks.php | |
parent | 565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff) |
applying patch to version 1.15.0
Diffstat (limited to 'includes/api/ApiQueryLangLinks.php')
-rw-r--r-- | includes/api/ApiQueryLangLinks.php | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index 8eaf8d02..3abe5e3d 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -71,8 +71,6 @@ class ApiQueryLangLinks extends ApiQueryBase { $this->addOption('LIMIT', $params['limit'] + 1); $res = $this->select(__METHOD__); - $data = array(); - $lastId = 0; // database has no ID 0 $count = 0; $db = $this->getDB(); while ($row = $db->fetchObject($res)) { @@ -82,23 +80,15 @@ class ApiQueryLangLinks extends ApiQueryBase { $this->setContinueEnumParameter('continue', "{$row->ll_from}|{$row->ll_lang}"); break; } - if ($lastId != $row->ll_from) { - if($lastId != 0) { - $this->addPageSubItems($lastId, $data); - $data = array(); - } - $lastId = $row->ll_from; - } - $entry = array('lang' => $row->ll_lang); ApiResult :: setContent($entry, $row->ll_title); - $data[] = $entry; - } - - if($lastId != 0) { - $this->addPageSubItems($lastId, $data); + $fit = $this->addPageSubItem($row->ll_from, $entry); + if(!$fit) + { + $this->setContinueEnumParameter('continue', "{$row->ll_from}|{$row->ll_lang}"); + break; + } } - $db->freeResult($res); } @@ -134,6 +124,6 @@ class ApiQueryLangLinks extends ApiQueryBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiQueryLangLinks.php 43271 2008-11-06 22:38:42Z siebrand $'; + return __CLASS__ . ': $Id: ApiQueryLangLinks.php 46845 2009-02-05 14:30:59Z catrope $'; } -} +}
\ No newline at end of file |