Page MenuHomePhabricator

wfGzipHandler HTTP_ACCEPT_ENCODING should have an isset() check
Closed, ResolvedPublic

Description

Author: jeroen

Description:
As sometimes it is not set:

[28-Oct-2007 05:15:42] PHP Notice: Undefined index: HTTP_ACCEPT_ENCODING in /usr/share/mediawiki1.10/includes/OutputHandler.php on line 26

Simple fix

8<-----------------------------------------------------------
function wfGzipHandler( $s ) {

if ( function_exists( 'gzencode' ) && !headers_sent() ) {
        $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] );
        if ( in_array( 'gzip', $tokens ) ) {

----------------------------------------------------------->8

SHOULD BE:

8<-----------------------------------------------------------
function wfGzipHandler( $s ) {

if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && function_exists( 'gzencode' ) && !headers_sent() ) {
        $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] );
        if ( in_array( 'gzip', $tokens ) ) {

----------------------------------------------------------->8

Greets,
Jeroen


Version: 1.10.x
Severity: trivial
URL: http://www.sixxs.net/wiki/

Details

Reference
bz11795

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:55 PM
bzimport set Reference to bz11795.
bzimport added a subscriber: Unknown Object (MLST).