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/ApiQueryLangLinks.php | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'includes/api/ApiQueryLangLinks.php') 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 -- cgit v1.2.2