r1054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r1053‎ | r1054 | r1055 >
Date:22:36, 1 January 2003
Author:vibber
Status:old
Tags:
Comment:
Note proxied pages in the log at least
Modified paths:
  • /trunk/phpwiki/newcodebase/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/newcodebase/OutputPage.php
@@ -324,11 +324,19 @@
325325 $elapsed = $now - $start;
326326
327327 if ( "" != $wgDebugLogFile ) {
 328+ if( $forward = $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'] )
 329+ $forward = " forwarded for $forward";
 330+ if( $client = $HTTP_SERVER_VARS['HTTP_CLIENT_IP'] )
 331+ $forward .= " client IP $client";
 332+ if( $from = $HTTP_SERVER_VARS['HTTP_FROM'] )
 333+ $forward .= " from $from";
 334+ if( $forward )
 335+ $forward = "\t(proxied via {$HTTP_SERVER_VARS['REMOTE_ADDR']}{$forward})";
328336 $log = sprintf( "%s\t%04.3f\t%s\n",
329337 date( "YmdHis" ), $elapsed,
330 - urldecode( $HTTP_SERVER_VARS['REQUEST_URI'] ) );
 338+ urldecode( $HTTP_SERVER_VARS['REQUEST_URI'] . $forward ) );
331339 error_log( $log, 3, $wgDebugLogFile );
332 - }
 340+ }
333341 $com = sprintf( "<!-- Time since request: %01.2f secs. -->",
334342 $elapsed );
335343 return $com;

Status & tagging log