MediaWiki  1.23.14
OutputHandler.php File Reference

Functions to be used with PHP's output buffer. More...

Go to the source code of this file.

Functions

 wfDoContentLength ( $length)
 Add a Content-Length header if possible. More...
 
 wfGzipHandler ( $s)
 Handler that compresses data with gzip if allowed by the Accept header. More...
 
 wfHtmlValidationHandler ( $s)
 Replace the output with an error if the HTML is not valid. More...
 
 wfMangleFlashPolicy ( $s)
 Mangle flash policy tags which open up the site to XSS attacks. More...
 
 wfOutputHandler ( $s)
 Standard output handler for use with ob_start. More...
 
 wfRequestExtension ()
 Get the "file extension" that some client apps will estimate from the currently-requested URL. More...
 

Detailed Description

Functions to be used with PHP's output buffer.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Definition in file OutputHandler.php.

Function Documentation

◆ wfDoContentLength()

wfDoContentLength (   $length)

Add a Content-Length header if possible.

This makes it cooperate with squid better.

Parameters
$lengthint

Definition at line 168 of file OutputHandler.php.

Referenced by wfOutputHandler().

◆ wfGzipHandler()

wfGzipHandler (   $s)

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

Unlike ob_gzhandler, it works for HEAD requests too.

Parameters
$sstring
Returns
string

Definition at line 103 of file OutputHandler.php.

References $ext, $s, as, global, wfClientAcceptsGzip(), wfDebug(), and wfRequestExtension().

Referenced by wfOutputHandler().

◆ wfHtmlValidationHandler()

wfHtmlValidationHandler (   $s)

Replace the output with an error if the HTML is not valid.

Parameters
$sstring
Returns
string

Definition at line 181 of file OutputHandler.php.

References $error, $line, $out, $s, array(), MWTidy\checkErrors(), Html\closeElement(), color, Html\element(), Html\htmlHeader(), Html\inlineStyle(), Html\openElement(), pre, and Html\rawElement().

Referenced by wfOutputHandler().

◆ wfMangleFlashPolicy()

wfMangleFlashPolicy (   $s)

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

Parameters
$sstring
Returns
string

Definition at line 154 of file OutputHandler.php.

References $s.

Referenced by wfOutputHandler().

◆ wfOutputHandler()

wfOutputHandler (   $s)

Standard output handler for use with ob_start.

Parameters
$sstring
Returns
string

Definition at line 30 of file OutputHandler.php.

References $name, $s, $value, as, global, wfDoContentLength(), wfGzipHandler(), wfHtmlValidationHandler(), and wfMangleFlashPolicy().

◆ wfRequestExtension()

wfRequestExtension ( )

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

This isn't on WebRequest because we need it when things aren't initialized

Access:\n private
Returns
string

Definition at line 75 of file OutputHandler.php.

References $path, and list.

Referenced by wfGzipHandler().