From: Brion Vibber Date: Sat, 15 Nov 2003 23:06:59 +0000 (+0000) Subject: Bug 839664; use 'empty' to avoid notifications for people with insane PHP error repor... X-Git-Tag: 1.1.0~152 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=7ab8c692ce7bb205a5c832c182a650f0dba167e4;p=lhc%2Fweb%2Fwiklou.git Bug 839664; use 'empty' to avoid notifications for people with insane PHP error reporting settings. Also commented out a section of code in setEncodings that was being run but the result thrown away --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 1bf0923483..e72c0d16c4 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -56,7 +56,7 @@ class OutputPage { $lastmod = gmdate( "D, j M Y H:i:s", wfTimestamp2Unix( max( $timestamp, $wgUser->mTouched ) ) ) . " GMT"; - if( $_SERVER["HTTP_IF_MODIFIED_SINCE"] != "" ) { + if( !empty( $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) ) { # IE sends sizes after the date like this: # Wed, 20 Aug 2003 06:51:19 GMT; length=5202 # this breaks strtotime(). @@ -264,18 +264,22 @@ class OutputPage { global $wgUser, $wgLang; $wgInputEncoding = strtolower( $wgInputEncoding ); - $s = $HTTP_SERVER_VARS['HTTP_ACCEPT_CHARSET']; if( $wgUser->getOption( 'altencoding' ) ) { $wgLang->setAltEncoding(); return; } - if ( "" == $s ) { + if ( empty( $_SERVER['HTTP_ACCEPT_CHARSET'] ) ) { $wgOutputEncoding = strtolower( $wgOutputEncoding ); return; } - $a = explode( ",", $s ); + + /* + # This code is unused anyway! + # Commenting out. --bv 2003-11-15 + + $a = explode( ",", $_SERVER['HTTP_ACCEPT_CHARSET'] ); $best = 0.0; $bestset = "*"; @@ -298,6 +302,7 @@ class OutputPage { # Disable for now # + */ $wgOutputEncoding = $wgInputEncoding; }