r111777 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111776‎ | r111777 | r111778 >
Date:19:28, 17 February 2012
Author:awjrichards
Status:resolved (Comments)
Tags:
Comment:
Removed usage of wfGetIP() and now just fetching IP from [REMOTE_ADDR], followup r111689, r111746
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.body.php
@@ -720,7 +720,11 @@
721721 // Fetch the REMOTE_ADDR and check if it's a trusted proxy.
722722 // Is this enough, or should we actually step through the entire
723723 // X-FORWARDED-FOR chain?
724 - $ip = wfGetIP();
 724+ if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
 725+ $ip = IP::canonicalize( $_SERVER['REMOTE_ADDR'] );
 726+ } else {
 727+ $ip = null;
 728+ }
725729 if ( wfIsTrustedProxy ( $ip )) {
726730 $wgRequest->response()->header( 'Cache-Control: no-cache, must-revalidate' );
727731 $wgRequest->response()->header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r111788Followup r111777, fixed mixed indentation caused by copy/paste failawjrichards21:22, 17 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111689Removes hardcoded 'wikimedia.org' when checking the proxy server before attem...awjrichards22:12, 16 February 2012
r111746Fix for PHP Fatal error: Call to protected method WebRequest::getRawIP() fro...preilly12:33, 17 February 2012

Comments

#Comment by Nikerabbit (talk | contribs)   21:14, 17 February 2012

Mixed indentation.

#Comment by Awjrichards (talk | contribs)   21:22, 17 February 2012

Oops. Fixed in r111788

Status & tagging log