From e3a4c27c75e23b591217dbd4d17dd770a2694502 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 18 Nov 2003 02:39:38 +0000 Subject: [PATCH] Finish removing HTTP_SERVER_VARS in favor of _SERVER; fix notifications for the paranoid --- includes/OutputPage.php | 20 ++++++++++---------- includes/Skin.php | 2 +- includes/Title.php | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index e72c0d16c4..37379c83a8 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -260,7 +260,7 @@ class OutputPage { function setEncodings() { - global $HTTP_SERVER_VARS, $wgInputEncoding, $wgOutputEncoding; + global $wgInputEncoding, $wgOutputEncoding; global $wgUser, $wgLang; $wgInputEncoding = strtolower( $wgInputEncoding ); @@ -308,7 +308,7 @@ class OutputPage { function reportTime() { - global $wgRequestTime, $wgDebugLogFile, $HTTP_SERVER_VARS; + global $wgRequestTime, $wgDebugLogFile; global $wgProfiling, $wgProfileStack, $wgProfileLimit, $wgUser; list( $usec, $sec ) = explode( " ", microtime() ); @@ -320,19 +320,19 @@ class OutputPage { if ( "" != $wgDebugLogFile ) { $prof = wfGetProfilingOutput( $start, $elapsed ); - if( $forward = $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'] ) - $forward = " forwarded for $forward"; - if( $client = $HTTP_SERVER_VARS['HTTP_CLIENT_IP'] ) - $forward .= " client IP $client"; - if( $from = $HTTP_SERVER_VARS['HTTP_FROM'] ) - $forward .= " from $from"; + if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) + $forward = " forwarded for " . $_SERVER['HTTP_X_FORWARDED_FOR']; + if( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) + $forward .= " client IP " . $_SERVER['HTTP_CLIENT_IP']; + if( !empty( $_SERVER['HTTP_FROM'] ) ) + $forward .= " from " . $_SERVER['HTTP_FROM']; if( $forward ) - $forward = "\t(proxied via {$HTTP_SERVER_VARS['REMOTE_ADDR']}{$forward})"; + $forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})"; if($wgUser->getId() == 0) $forward .= " anon"; $log = sprintf( "%s\t%04.3f\t%s\n", gmdate( "YmdHis" ), $elapsed, - urldecode( $HTTP_SERVER_VARS['REQUEST_URI'] . $forward ) ); + urldecode( $_SERVER['REQUEST_URI'] . $forward ) ); error_log( $log . $prof, 3, $wgDebugLogFile ); } $com = sprintf( "", diff --git a/includes/Skin.php b/includes/Skin.php index fa156bec71..1b4db0401f 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -331,7 +331,7 @@ class Skin { # function afterContent() { - global $wgUser, $wgOut, $wgServer, $HTTP_SERVER_VARS; + global $wgUser, $wgOut, $wgServer; global $wgTitle; if ( $wgOut->isPrintable() ) { diff --git a/includes/Title.php b/includes/Title.php index 10311879af..2480679b0e 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -56,7 +56,7 @@ class Title { function newFromURL( $url ) { - global $wgLang, $wgServer, $HTTP_SERVER_VARS; + global $wgLang, $wgServer; $t = new Title(); $s = urldecode( $url ); # This is technically wrong, as anything -- 2.20.1