MediaWiki master
opensearch_desc.php
Go to the documentation of this file.
1<?php
29// This endpoint is supposed to be independent of request cookies and other
30// details of the session. Enforce this constraint with respect to session use.
31define( 'MW_NO_SESSION', 1 );
32
33define( 'MW_ENTRY_POINT', 'opensearch_desc' );
34
35require_once __DIR__ . '/includes/WebStart.php';
36
37$url = wfScript( 'rest' ) . '/v1/search';
38$ctype = $wgRequest->getRawVal( 'ctype' );
39
40if ( $ctype !== null ) {
41 $url = wfAppendQuery( $url, [ 'ctype' => $ctype ] );
42}
43
44$wgRequest->response()->header( 'Location: ' . $url, true, 308 );
45$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:447