MediaWiki  1.33.0
MediaWiki\OutputHandler Class Reference

Static Public Member Functions

static handle ( $s)
 Standard output handler for use with ob_start. More...
 

Static Private Member Functions

static emitContentLength ( $length)
 Add a Content-Length header if possible. More...
 
static findUriExtension ()
 Get the "file extension" that some client apps will estimate from the currently-requested URL. More...
 
static handleGzip ( $s)
 Handler that compresses data with gzip if allowed by the Accept header. More...
 
static mangleFlashPolicy ( $s)
 Mangle flash policy tags which open up the site to XSS attacks. More...
 

Detailed Description

Since
1.31

Definition at line 28 of file OutputHandler.php.

Member Function Documentation

◆ emitContentLength()

static MediaWiki\OutputHandler::emitContentLength (   $length)
staticprivate

Add a Content-Length header if possible.

This makes it cooperate with CDN better.

Parameters
int$length

Definition at line 154 of file OutputHandler.php.

◆ findUriExtension()

static MediaWiki\OutputHandler::findUriExtension ( )
staticprivate

Get the "file extension" that some client apps will estimate from the currently-requested URL.

This isn't a WebRequest method, because we need it before the class loads.

Todo:
As of 2018, this actually runs after autoloader in Setup.php, so WebRequest seems like a good place for this.
Returns
string

Definition at line 61 of file OutputHandler.php.

References $path, and list.

◆ handle()

static MediaWiki\OutputHandler::handle (   $s)
static

Standard output handler for use with ob_start.

Parameters
string$sWeb response output
Returns
string

Definition at line 35 of file OutputHandler.php.

References $s, $wgDisableOutputCompression, and $wgMangleFlashPolicy.

◆ handleGzip()

static MediaWiki\OutputHandler::handleGzip (   $s)
staticprivate

Handler that compresses data with gzip if allowed by the Accept header.

Unlike ob_gzhandler, it works for HEAD requests too.

Parameters
string$sWeb response output
Returns
string

Definition at line 89 of file OutputHandler.php.

References $ext, $header, $s, $wgUseKeyHeader, as, wfClientAcceptsGzip(), and wfDebug().

◆ mangleFlashPolicy()

static MediaWiki\OutputHandler::mangleFlashPolicy (   $s)
staticprivate

Mangle flash policy tags which open up the site to XSS attacks.

Parameters
string$sWeb response output
Returns
string

Definition at line 140 of file OutputHandler.php.

References $s.


The documentation for this class was generated from the following file: