MediaWiki  REL1_22
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.
 wfGzipHandler ($s)
 Handler that compresses data with gzip if allowed by the Accept header.
 wfHtmlValidationHandler ($s)
 Replace the output with an error if the HTML is not valid.
 wfMangleFlashPolicy ($s)
 Mangle flash policy tags which open up the site to XSS attacks.
 wfOutputHandler ($s)
 Standard output handler for use with ob_start.
 wfRequestExtension ()
 Get the "file extension" that some client apps will estimate from the currently-requested URL.

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 ( length)

Add a Content-Length header if possible.

This makes it cooperate with squid better.

Parameters:
$lengthint

Definition at line 166 of file OutputHandler.php.

Referenced by wfOutputHandler().

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 101 of file OutputHandler.php.

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

Referenced by wfOutputHandler().

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

Parameters:
$sstring
Returns:
string

Definition at line 179 of file OutputHandler.php.

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

Referenced by wfOutputHandler().

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

Parameters:
$sstring
Returns:
string

Definition at line 152 of file OutputHandler.php.

References $s.

Referenced by 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().

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:
private
Returns:
string

Definition at line 73 of file OutputHandler.php.

References $path, and list.

Referenced by wfGzipHandler().