summaryrefslogtreecommitdiff
path: root/includes/api/ApiQuerySearch.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/ApiQuerySearch.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/api/ApiQuerySearch.php')
-rw-r--r--includes/api/ApiQuerySearch.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php
index cb020fff..668f00e5 100644
--- a/includes/api/ApiQuerySearch.php
+++ b/includes/api/ApiQuerySearch.php
@@ -87,7 +87,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
$this->dieUsage("{$what} search is disabled",
"search-{$what}-disabled");
- $data = array ();
+ $titles = array ();
$count = 0;
while( $result = $matches->next() ) {
if (++ $count > $limit) {
@@ -102,20 +102,23 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
$title = $result->getTitle();
if (is_null($resultPageSet)) {
- $data[] = array(
- 'ns' => intval($title->getNamespace()),
- 'title' => $title->getPrefixedText());
+ $vals = array();
+ ApiQueryBase::addTitleInfo($vals, $title);
+ $fit = $this->getResult()->addValue(array('query', $this->getModuleName()), null, $vals);
+ if(!$fit)
+ {
+ $this->setContinueEnumParameter('offset', $params['offset'] + $count - 1);
+ break;
+ }
} else {
- $data[] = $title;
+ $titles[] = $title;
}
}
if (is_null($resultPageSet)) {
- $result = $this->getResult();
- $result->setIndexedTagName($data, 'p');
- $result->addValue('query', $this->getModuleName(), $data);
+ $this->getResult()->setIndexedTagName_internal(array('query', $this->getModuleName()), 'p');
} else {
- $resultPageSet->populateFromTitles($data);
+ $resultPageSet->populateFromTitles($titles);
}
}
@@ -170,6 +173,6 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQuerySearch.php 44186 2008-12-03 19:33:57Z catrope $';
+ return __CLASS__ . ': $Id: ApiQuerySearch.php 47865 2009-02-27 16:03:01Z catrope $';
}
-}
+} \ No newline at end of file