r106377 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106376‎ | r106377 | r106378 >
Date:21:34, 15 December 2011
Author:awjrichards
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/LandingCheck (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/LandingCheck/LandingCheck.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/LandingCheck/SpecialLandingCheck.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/LandingCheck/LandingCheck.php
@@ -14,7 +14,7 @@
1515 'path' => __FILE__,
1616 'name' => 'LandingCheck',
1717 'version' => '2.0',
18 - 'url' => 'http://www.mediawiki.org/wiki/Extension:LandingCheck',
 18+ 'url' => 'https://www.mediawiki.org/wiki/Extension:LandingCheck',
1919 'author' => array( 'Ryan Kaldari', 'Arthur Richards' ),
2020 'descriptionmsg' => 'landingcheck-desc',
2121 );
Property changes on: branches/wmf/1.18wmf1/extensions/LandingCheck/LandingCheck.php
___________________________________________________________________
Modified: svn:mergeinfo
2222 Merged /trunk/extensions/LandingCheck/LandingCheck.php:r106136,106159-106160
Index: branches/wmf/1.18wmf1/extensions/LandingCheck/SpecialLandingCheck.php
@@ -11,6 +11,13 @@
1212 */
1313 class SpecialLandingCheck extends SpecialPage {
1414 protected $localServerType = null;
 15+ /**
 16+ * If basic is set to true, do a local redirect, ignore priority, and don't pass tracking
 17+ * params. This is for non-fundraising links that just need localization.
 18+ *
 19+ * @var boolean
 20+ */
 21+ protected $basic = false;
1522
1623 public function __construct() {
1724 // Register special page
@@ -22,8 +29,9 @@
2330
2431 // Pull in query string parameters
2532 $language = $wgRequest->getVal( 'language', 'en' );
 33+ $this->basic = $wgRequest->getBool( 'basic' );
 34+ $country = $wgRequest->getVal( 'country' );
2635
27 - $country = $wgRequest->getVal( 'country' );
2836 // If no country was passed, try to do GeoIP lookup
2937 // Requires php5-geoip package
3038 if ( !$country && function_exists( 'geoip_country_code_by_name' ) ) {
@@ -85,8 +93,11 @@
8694 */
8795 public function routeRedirect( $country, $language, $priority ) {
8896 $localServerType = $this->getLocalServerType();
89 -
90 - if ( $localServerType == 'local' ) {
 97+
 98+ if ( $this->basic ) {
 99+ $this->localRedirect( $country, $language, false );
 100+
 101+ } elseif ( $localServerType == 'local' ) {
91102 $this->localRedirect( $country, $language, $priority );
92103
93104 } elseif ( $priority && $localServerType == 'priority' ) {
@@ -169,7 +180,11 @@
170181 foreach ( $targetTexts as $targetText ) {
171182 $target = Title::newFromText( $targetText );
172183 if ( $target && $target->isKnown() && $target->getNamespace() == NS_MAIN ) {
173 - $wgOut->redirect( $target->getLocalURL( $tracking ) );
 184+ if ( $this->basic ) {
 185+ $wgOut->redirect( $target->getLocalURL() );
 186+ } else {
 187+ $wgOut->redirect( $target->getLocalURL( $tracking ) );
 188+ }
174189 return;
175190 }
176191 }
Property changes on: branches/wmf/1.18wmf1/extensions/LandingCheck/SpecialLandingCheck.php
___________________________________________________________________
Modified: svn:mergeinfo
177192 Merged /trunk/extensions/LandingCheck/SpecialLandingCheck.php:r106159-106160
Property changes on: branches/wmf/1.18wmf1/extensions/LandingCheck
___________________________________________________________________
Modified: svn:mergeinfo
178193 Merged /trunk/extensions/LandingCheck:r106136,106159-106160

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106136Update a butt-ton of extension about URLs to point to https://www.mediawiki.org/brion23:49, 13 December 2011
r106159adding "basic" functionality to LandingCheckkaldari01:38, 14 December 2011
r106160actually it looks like you dont need the variable name herekaldari01:40, 14 December 2011

Status & tagging log