dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "languages: Use static array files for normalizer data"
[lhc/web/wiklou.git]
/
opensearch_desc.php
diff --git
a/opensearch_desc.php
b/opensearch_desc.php
index
bef1688
..
b92ff2e
100644
(file)
--- a/
opensearch_desc.php
+++ b/
opensearch_desc.php
@@
-20,6
+20,11
@@
* @file
*/
* @file
*/
+// This endpoint is supposed to be independent of request cookies and other
+// details of the session. Log warnings for violations of the no-session
+// constraint.
+define( 'MW_NO_SESSION', 'warn' );
+
require_once __DIR__ . '/includes/WebStart.php';
if ( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
require_once __DIR__ . '/includes/WebStart.php';
if ( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
@@
-41,8
+46,8
@@
$response->header( 'Cache-control: max-age=600' );
print '<?xml version="1.0"?>';
print Xml::openElement( 'OpenSearchDescription',
[
print '<?xml version="1.0"?>';
print Xml::openElement( 'OpenSearchDescription',
[
- 'xmlns' => 'http://
a9.com/-/spec/opensearch/1.1/
',
- 'xmlns:moz' => 'http://www.mozilla.org/2006/browser/search/' ] );
+ 'xmlns' => 'http://
www.opensearch.org/Specifications/OpenSearch/1.1
',
+ 'xmlns:moz' => 'http
s
://www.mozilla.org/2006/browser/search/' ] );
/* The spec says the ShortName must be no longer than 16 characters,
* but 16 is *realllly* short. In practice, browsers don't appear to care
/* The spec says the ShortName must be no longer than 16 characters,
* but 16 is *realllly* short. In practice, browsers don't appear to care
@@
-80,7
+85,7
@@
$urls[] = [
'template' => $searchPage->getCanonicalURL( 'search={searchTerms}' ) ];
foreach ( $wgOpenSearchTemplates as $type => $template ) {
'template' => $searchPage->getCanonicalURL( 'search={searchTerms}' ) ];
foreach ( $wgOpenSearchTemplates as $type => $template ) {
- if ( !$template
&& $wgEnableAPI
) {
+ if ( !$template ) {
$template = ApiOpenSearch::getOpenSearchTemplate( $type );
}
$template = ApiOpenSearch::getOpenSearchTemplate( $type );
}