For MediaWiki (recent comments | status changes | tags | authors | states | release notes | statistics)
Index: trunk/phase3/includes/ProxyTools.php =================================================================== --- trunk/phase3/includes/ProxyTools.php (revision 43783) +++ trunk/phase3/includes/ProxyTools.php (revision 43784) @@ -67,7 +67,7 @@ * @return string */ function wfGetIP() { - global $wgIP; + global $wgIP, $wgUsePrivateIPs; # Return cached result if ( !empty( $wgIP ) ) { @@ -97,8 +97,10 @@ foreach ( $ipchain as $i => $curIP ) { $curIP = IP::canonicalize( $curIP ); if ( wfIsTrustedProxy( $curIP ) ) { - if ( isset( $ipchain[$i + 1] ) && IP::isPublic( $ipchain[$i + 1] ) ) { - $ip = $ipchain[$i + 1]; + if ( isset( $ipchain[$i + 1] ) ) { + if( $wgUsePrivateIPs || IP::isPublic( $ipchain[$i + 1 ] ) ) { + $ip = $ipchain[$i + 1]; + } } } else { break; Index: trunk/phase3/includes/DefaultSettings.php =================================================================== --- trunk/phase3/includes/DefaultSettings.php (revision 43783) +++ trunk/phase3/includes/DefaultSettings.php (revision 43784) @@ -1590,6 +1590,9 @@ # $wgHTCPMulticastAddress = "224.0.0.85"; $wgHTCPMulticastAddress = false; +/** Should forwarded Private IPs be accepted? */ +$wgUsePrivateIPs = false; + # Cookie settings: # /** Index: trunk/phase3/RELEASE-NOTES =================================================================== --- trunk/phase3/RELEASE-NOTES (revision 43783) +++ trunk/phase3/RELEASE-NOTES (revision 43784) @@ -63,6 +63,8 @@ * Image namespace and accompanying talk namespace renamed to File. For backward compatibility purposes, Image still works. External tools may need to be updated. +* MediaWiki can be forced to use private IPs forwarded by a proxy server by + using $wgUsePrivateIPs. === Migrated extensions === The following extensions are migrated into MediaWiki 1.14: