MegaAlex has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96162
Change subject: API: Add default setting for OpenSearch limit parameter
......................................................................
API: Add default setting for OpenSearch limit parameter
This is done as part of a GCI 2013 task.
Fixes bug 30089.
Change-Id: I4c1a850520976a5b8b433feee4807c5f6960e3ac
---
M includes/DefaultSettings.php
M includes/api/ApiOpenSearch.php
2 files changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/62/96162/1
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index d428910..8faae60 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5237,6 +5237,12 @@
$wgEnableOpenSearchSuggest = true;
/**
+ * Integer defining default number of entries to show on
+ * OpenSearch call.
+ */
+$wgOpenSearchDefaultLimit = 10;
+
+/**
* Expiry time for search suggestion responses
*/
$wgSearchSuggestCacheExpiry = 1200;
diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php
index 433b743..4b8578b 100644
--- a/includes/api/ApiOpenSearch.php
+++ b/includes/api/ApiOpenSearch.php
@@ -90,10 +90,12 @@
}
public function getAllowedParams() {
+ global $wgOpenSearchDefaultLimit;
+
return array(
'search' => null,
'limit' => array(
- ApiBase::PARAM_DFLT => 10,
+ ApiBase::PARAM_DFLT =>
$wgOpenSearchDefaultLimit,
ApiBase::PARAM_TYPE => 'limit',
ApiBase::PARAM_MIN => 1,
ApiBase::PARAM_MAX => 100,
--
To view, visit https://gerrit.wikimedia.org/r/96162
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c1a850520976a5b8b433feee4807c5f6960e3ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MegaAlex <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits