Last modified: 2010-05-15 15:50:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T13795, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11795 - wfGzipHandler HTTP_ACCEPT_ENCODING should have an isset() check
wfGzipHandler HTTP_ACCEPT_ENCODING should have an isset() check
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.10.x
All All
: Normal trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.sixxs.net/wiki/
: easy, patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-28 09:46 UTC by Jeroen Massar
Modified: 2010-05-15 15:50 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jeroen Massar 2007-10-28 09:46:16 UTC
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
Comment 1 Brion Vibber 2007-10-29 17:42:05 UTC
r27021

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links