X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=opensearch_desc.php;h=b9b21611d0279cb5faafb760c9c616a6d503e8d0;hb=33e1bbbeaecb90eb6149367ad21709504c66e1d0;hp=bef168878f1df4fc3517abe347d22de53af625e0;hpb=c340c41b37b5079ba90489f6b212bb8e4642031a;p=lhc%2Fweb%2Fwiklou.git diff --git a/opensearch_desc.php b/opensearch_desc.php index bef168878f..b9b21611d0 100644 --- a/opensearch_desc.php +++ b/opensearch_desc.php @@ -20,6 +20,11 @@ * @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' ) { @@ -80,7 +85,7 @@ $urls[] = [ 'template' => $searchPage->getCanonicalURL( 'search={searchTerms}' ) ]; foreach ( $wgOpenSearchTemplates as $type => $template ) { - if ( !$template && $wgEnableAPI ) { + if ( !$template ) { $template = ApiOpenSearch::getOpenSearchTemplate( $type ); }