X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=opensearch_desc.php;h=5e5e35d3334b1be37e63aac184df5ecbd3cd52a0;hb=2c4c3381008e96a22f3bedb1449d551e4b723bff;hp=ecd5051cd991b9c5a198db0533920db5df80b5bf;hpb=8734fe02b84c0fdd6fa53454b23ce9239b50dc75;p=lhc%2Fweb%2Fwiklou.git diff --git a/opensearch_desc.php b/opensearch_desc.php index ecd5051cd9..5e5e35d333 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