r51785 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51784‎ | r51785 | r51786 >
Date:09:34, 12 June 2009
Author:ialex
Status:ok
Tags:
Comment:
Fix for r51774, r51784: set '127.0.0.1' as IP for CLI, but with explicit check for $wgCommandLineMode so that the exception "Unable to determine IP" is not thrown in this case.
Modified paths:
  • /trunk/phase3/includes/ProxyTools.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProxyTools.php
@@ -67,7 +67,7 @@
6868 * @return string
6969 */
7070 function wfGetIP() {
71 - global $wgIP, $wgUsePrivateIPs;
 71+ global $wgIP, $wgUsePrivateIPs, $wgCommandLineMode;
7272
7373 # Return cached result
7474 if ( !empty( $wgIP ) ) {
@@ -81,6 +81,8 @@
8282 # Client connecting to this webserver
8383 if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
8484 $ip = IP::canonicalize( $_SERVER['REMOTE_ADDR'] );
 85+ } elseif( $wgCommandLineMode ) {
 86+ $ip = '127.0.0.1';
8587 }
8688 if( $ip ) {
8789 $ipchain[] = $ip;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r51774Revert r51725 (fall back to 127.0.0.1 when IP cannot be determined). On furth...demon01:34, 12 June 2009
r51784Fixes for r51774:...ialex09:17, 12 June 2009

Status & tagging log