r77609 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77608‎ | r77609 | r77610 >
Date:21:51, 2 December 2010
Author:tomasz
Status:ok
Tags:
Comment:
Merging in r77519, 77520, and 77521
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/LandingCheck (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/LandingCheck/SpecialLandingCheck.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/LandingCheck/SpecialLandingCheck.php
@@ -21,7 +21,19 @@
2222
2323 // Pull in query string parameters
2424 $language = $wgRequest->getVal( 'language', 'en' );
25 - $country = $wgRequest->getVal( 'country', 'US' );
 25+
 26+ $country = $wgRequest->getVal( 'country' );
 27+ // If no country was passed, try to do GeoIP lookup
 28+ if ( !$country && function_exists( geoip_country_code_by_name ) ) {
 29+ $ip = wfGetIP();
 30+ if ( IP::isValid( $ip ) ) {
 31+ $country = geoip_country_code_by_name( $ip );
 32+ }
 33+ }
 34+ if ( !$country ) {
 35+ $country = 'US'; // Default
 36+ }
 37+
2638 $landingPage = $wgRequest->getVal( 'landing_page', 'Donate' );
2739
2840 // Construct new query string for tracking
Property changes on: branches/wmf/1.16wmf4/extensions/LandingCheck
___________________________________________________________________
Modified: svn:mergeinfo
2941 Merged /trunk/extensions/LandingCheck:r77519-77521

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77519IP lookup if no country passedkaldari02:33, 1 December 2010

Status & tagging log