X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiOpenSearch.php;h=7fb045e3b242d981a84a138c5a42c30395a7abc0;hb=0525f22b8825c617fffa98f191ab07e8113da085;hp=68b62af5711a7b39898a70bcbfa363e578197f7c;hpb=bc1cd69a5950c516e9f34d50d0ce6b1547d9f060;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index 68b62af571..7fb045e3b2 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -45,7 +45,6 @@ class ApiOpenSearch extends ApiBase { } public function execute() { - global $wgEnableOpenSearchSuggest, $wgSearchSuggestCacheExpiry; $params = $this->extractRequestParams(); $search = $params['search']; $limit = $params['limit']; @@ -53,11 +52,11 @@ class ApiOpenSearch extends ApiBase { $suggest = $params['suggest']; // Some script that was loaded regardless of wgEnableOpenSearchSuggest, likely cached. - if ( $suggest && !$wgEnableOpenSearchSuggest ) { + if ( $suggest && !$this->getConfig()->get( 'EnableOpenSearchSuggest' ) ) { $searches = array(); } else { // Open search results may be stored for a very long time - $this->getMain()->setCacheMaxAge( $wgSearchSuggestCacheExpiry ); + $this->getMain()->setCacheMaxAge( $this->getConfig()->get( 'SearchSuggestCacheExpiry' ) ); $this->getMain()->setCacheMode( 'public' ); $searcher = new StringPrefixSearch; @@ -70,12 +69,10 @@ class ApiOpenSearch extends ApiBase { } public function getAllowedParams() { - global $wgOpenSearchDefaultLimit; - return array( 'search' => null, 'limit' => array( - ApiBase::PARAM_DFLT => $wgOpenSearchDefaultLimit, + ApiBase::PARAM_DFLT => $this->getConfig()->get( 'OpenSearchDefaultLimit' ), ApiBase::PARAM_TYPE => 'limit', ApiBase::PARAM_MIN => 1, ApiBase::PARAM_MAX => 100,