Index: branches/wmf/1.18wmf1/extensions/LandingCheck/LandingCheck.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | 'path' => __FILE__, |
16 | 16 | 'name' => 'LandingCheck', |
17 | 17 | 'version' => '2.0', |
18 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:LandingCheck', |
| 18 | + 'url' => 'https://www.mediawiki.org/wiki/Extension:LandingCheck', |
19 | 19 | 'author' => array( 'Ryan Kaldari', 'Arthur Richards' ), |
20 | 20 | 'descriptionmsg' => 'landingcheck-desc', |
21 | 21 | ); |
Property changes on: branches/wmf/1.18wmf1/extensions/LandingCheck/LandingCheck.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
22 | 22 | Merged /trunk/extensions/LandingCheck/LandingCheck.php:r106136,106159-106160 |
Index: branches/wmf/1.18wmf1/extensions/LandingCheck/SpecialLandingCheck.php |
— | — | @@ -11,6 +11,13 @@ |
12 | 12 | */ |
13 | 13 | class SpecialLandingCheck extends SpecialPage { |
14 | 14 | 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; |
15 | 22 | |
16 | 23 | public function __construct() { |
17 | 24 | // Register special page |
— | — | @@ -22,8 +29,9 @@ |
23 | 30 | |
24 | 31 | // Pull in query string parameters |
25 | 32 | $language = $wgRequest->getVal( 'language', 'en' ); |
| 33 | + $this->basic = $wgRequest->getBool( 'basic' ); |
| 34 | + $country = $wgRequest->getVal( 'country' ); |
26 | 35 | |
27 | | - $country = $wgRequest->getVal( 'country' ); |
28 | 36 | // If no country was passed, try to do GeoIP lookup |
29 | 37 | // Requires php5-geoip package |
30 | 38 | if ( !$country && function_exists( 'geoip_country_code_by_name' ) ) { |
— | — | @@ -85,8 +93,11 @@ |
86 | 94 | */ |
87 | 95 | public function routeRedirect( $country, $language, $priority ) { |
88 | 96 | $localServerType = $this->getLocalServerType(); |
89 | | - |
90 | | - if ( $localServerType == 'local' ) { |
| 97 | + |
| 98 | + if ( $this->basic ) { |
| 99 | + $this->localRedirect( $country, $language, false ); |
| 100 | + |
| 101 | + } elseif ( $localServerType == 'local' ) { |
91 | 102 | $this->localRedirect( $country, $language, $priority ); |
92 | 103 | |
93 | 104 | } elseif ( $priority && $localServerType == 'priority' ) { |
— | — | @@ -169,7 +180,11 @@ |
170 | 181 | foreach ( $targetTexts as $targetText ) { |
171 | 182 | $target = Title::newFromText( $targetText ); |
172 | 183 | 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 | + } |
174 | 189 | return; |
175 | 190 | } |
176 | 191 | } |
Property changes on: branches/wmf/1.18wmf1/extensions/LandingCheck/SpecialLandingCheck.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
177 | 192 | Merged /trunk/extensions/LandingCheck/SpecialLandingCheck.php:r106159-106160 |
Property changes on: branches/wmf/1.18wmf1/extensions/LandingCheck |
___________________________________________________________________ |
Modified: svn:mergeinfo |
178 | 193 | Merged /trunk/extensions/LandingCheck:r106136,106159-106160 |