summaryrefslogtreecommitdiff
path: root/opensearch_desc.php
diff options
context:
space:
mode:
Diffstat (limited to 'opensearch_desc.php')
-rw-r--r--opensearch_desc.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/opensearch_desc.php b/opensearch_desc.php
index ecd5051c..5e5e35d3 100644
--- a/opensearch_desc.php
+++ b/opensearch_desc.php
@@ -78,13 +78,18 @@ $urls[] = array(
'method' => 'get',
'template' => $searchPage->getCanonicalURL( 'search={searchTerms}' ) );
-if ( $wgEnableAPI ) {
- // JSON interface for search suggestions.
- // Supported in Firefox 2 and later.
- $urls[] = array(
- 'type' => 'application/x-suggestions+json',
- 'method' => 'get',
- 'template' => SearchEngine::getOpenSearchTemplate() );
+foreach ( $wgOpenSearchTemplates as $type => $template ) {
+ if ( !$template && $wgEnableAPI ) {
+ $template = ApiOpenSearch::getOpenSearchTemplate( $type );
+ }
+
+ if ( $template ) {
+ $urls[] = array(
+ 'type' => $type,
+ 'method' => 'get',
+ 'template' => $template,
+ );
+ }
}
// Allow hooks to override the suggestion URL settings in a more