Index: branches/wmf/1.19wmf1/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php |
— | — | @@ -32,7 +32,12 @@ |
33 | 33 | private static $debugOutput = array(); |
34 | 34 | private static $displayDebugOutput = false; |
35 | 35 | private static $formatMobileUrl = '//%s.m.wikipedia.org/'; |
| 36 | + |
| 37 | + /** |
| 38 | + * @var Title |
| 39 | + */ |
36 | 40 | private static $title; |
| 41 | + |
37 | 42 | private static $isFilePage; |
38 | 43 | public static $isMainPage = false; |
39 | 44 | private static $acceptBilling; |
— | — | @@ -55,7 +60,7 @@ |
56 | 61 | * @return bool |
57 | 62 | */ |
58 | 63 | public function beforePageDisplayHTML( &$out, &$text ) { |
59 | | - global $wgRequest, $wgConf, $wgEnableZeroRatedMobileAccessTesting, $wgZeroDisableImages, $wgSitename; |
| 64 | + global $wgRequest, $wgConf, $wgEnableZeroRatedMobileAccessTesting, $wgZeroDisableImages; |
60 | 65 | wfProfileIn( __METHOD__ ); |
61 | 66 | |
62 | 67 | $DB = wfGetDB( DB_MASTER ); |
— | — | @@ -110,10 +115,10 @@ |
111 | 116 | } |
112 | 117 | |
113 | 118 | if ( self::$isFilePage && self::$acceptBilling !== 'yes' && self::$renderZeroRatedBanner === true ) { |
| 119 | + $referrer = $wgRequest->getHeader( 'referer' ); |
114 | 120 | $acceptBillingYes = Html::rawElement( 'a', |
115 | 121 | array( 'href' => str_replace( '.wikipedia.org/', '.m.wikipedia.org/', wfExpandUrl( $wgRequest->appendQuery( 'acceptbilling=yes' . urlencode( $referrer ) ), PROTO_CURRENT ) ) ), |
116 | 122 | wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-yes' ) ); |
117 | | - $referrer = $wgRequest->getHeader( 'referer' ); |
118 | 123 | $acceptBillingNo = Html::rawElement( 'a', |
119 | 124 | array( 'href' => $wgRequest->appendQuery( 'acceptbilling=no&returnto=' . urlencode( $referrer ) ) ), |
120 | 125 | wfMsg( 'zero-rated-mobile-access-banner-text-data-charges-no' ) ); |
— | — | @@ -210,6 +215,7 @@ |
211 | 216 | wfMessage( 'zero-rated-mobile-access-home-page-selection', |
212 | 217 | $languageName )->inLanguage( $languageCode ) |
213 | 218 | ); |
| 219 | + $languageLink = str_replace( '.m.wikipedia.org', '.zero.wikipedia.org', $languageLink ); |
214 | 220 | $output .= Html::rawElement( 'h3', array( 'id' => 'lang_' . $languageCode ), $languageLink ); |
215 | 221 | } |
216 | 222 | } |