X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=opensearch_desc.php;h=82e74b2044221d16afc96515bc2a6ad2bcf37394;hb=cf4ba5883d27a50ae03b12ddd677180f2a5da08f;hp=d766f1970fdfb954430e8d869044ed53dc5a784b;hpb=8e476b31cc2e6f8aef6f8617a47ec78f37e4dc4a;p=lhc%2Fweb%2Fwiklou.git diff --git a/opensearch_desc.php b/opensearch_desc.php index d766f1970f..82e74b2044 100644 --- a/opensearch_desc.php +++ b/opensearch_desc.php @@ -6,7 +6,7 @@ require_once( dirname(__FILE__) . '/includes/WebStart.php' ); require_once( dirname(__FILE__) . '/languages/Names.php' ); -$fullName = "$wgSitename ({$wgLanguageNames[$wgLanguageCode]})"; +$fullName = wfMsgForContent( 'opensearch-desc' ); $shortName = htmlspecialchars( mb_substr( $fullName, 0, 24 ) ); $siteName = htmlspecialchars( $fullName ); @@ -16,11 +16,17 @@ $favicon = htmlspecialchars( wfExpandUrl( $wgFavicon ) ); $title = SpecialPage::getTitleFor( 'Search' ); $template = $title->escapeFullURL( 'search={searchTerms}' ); -$suggest = htmlspecialchars($wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}'); +$suggest = htmlspecialchars(SearchEngine::getOpenSearchTemplate() ); $response = $wgRequest->response(); -$response->header( 'Content-type: application/opensearchdescription+xml' ); +if( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) { + // Makes testing tweaks about a billion times easier + $ctype = 'application/xml'; +} else { + $ctype = 'application/opensearchdescription+xml'; +} +$response->header( "Content-type: $ctype" ); # Set an Expires header so that squid can cache it for a short time # Short enough so that the sysadmin barely notices when $wgSitename is changed