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/ApiOpenSearch.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'includes/api/ApiOpenSearch.php') diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index 2da92059..8fc1f32b 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -42,10 +42,14 @@ class ApiOpenSearch extends ApiBase { } public function execute() { + global $wgEnableMWSuggest; $params = $this->extractRequestParams(); $search = $params['search']; $limit = $params['limit']; $namespaces = $params['namespace']; + $suggest = $params['suggest']; + # $wgEnableMWSuggest hit incoming when $wgEnableMWSuggest is disabled + if( $suggest && !$wgEnableMWSuggest ) return; // Open search results may be stored for a very long time $this->getMain()->setCacheMaxAge(1200); @@ -61,7 +65,7 @@ class ApiOpenSearch extends ApiBase { public function getAllowedParams() { return array ( 'search' => null, - 'limit' => array ( + 'limit' => array( ApiBase :: PARAM_DFLT => 10, ApiBase :: PARAM_TYPE => 'limit', ApiBase :: PARAM_MIN => 1, @@ -73,6 +77,7 @@ class ApiOpenSearch extends ApiBase { ApiBase :: PARAM_TYPE => 'namespace', ApiBase :: PARAM_ISMULTI => true ), + 'suggest' => false, ); } @@ -81,6 +86,7 @@ class ApiOpenSearch extends ApiBase { 'search' => 'Search string', 'limit' => 'Maximum amount of results to return', 'namespace' => 'Namespaces to search', + 'suggest' => 'Do nothing if $wgEnableMWSuggest is false', ); } @@ -95,6 +101,6 @@ class ApiOpenSearch extends ApiBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiOpenSearch.php 35098 2008-05-20 17:13:28Z ialex $'; + return __CLASS__ . ': $Id: ApiOpenSearch.php 47188 2009-02-12 17:27:05Z catrope $'; } } -- cgit v1.2.3-54-g00ecf