MediaWiki master
opensearch_desc.php
Go to the documentation of this file.
1<?php
15// This endpoint is supposed to be independent of request cookies and other
16// details of the session. Enforce this constraint with respect to session use.
17define( 'MW_NO_SESSION', 1 );
18
19define( 'MW_ENTRY_POINT', 'opensearch_desc' );
20
21require_once __DIR__ . '/includes/WebStart.php';
22
23$url = wfScript( 'rest' ) . '/v1/search';
24$ctype = $wgRequest->getRawVal( 'ctype' );
25
26if ( $ctype !== null ) {
27 $url = wfAppendQuery( $url, [ 'ctype' => $ctype ] );
28}
29
30$wgRequest->response()->header( 'Location: ' . $url, true, 308 );
31$wgRequest->response()->header( 'Cache-control: max-age=600' );
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
wfScript( $script='index')
Get the URL path to a MediaWiki entry point.
global $wgRequest
Definition Setup.php:434