X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=opensearch_desc.php;h=b9b21611d0279cb5faafb760c9c616a6d503e8d0;hb=0eb1619898438735b04293b5aef9a36650258741;hp=bef168878f1df4fc3517abe347d22de53af625e0;hpb=40a628a501fc05bb00e834fe359ca4061925f320;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 ); }