Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -51,6 +51,14 @@ |
52 | 52 | |
53 | 53 | $wgMobileDomain = '.m.'; |
54 | 54 | |
| 55 | +/** |
| 56 | + * URL for script used to disable mobile site |
| 57 | + * (protocol, host, optional port; path portion) |
| 58 | + * |
| 59 | + * e.g., http://en.wikipedia.org/w/mobileRedirect.php |
| 60 | + */ |
| 61 | +$wgMobileRedirectFormAction; |
| 62 | + |
55 | 63 | $wgExtMobileFrontend = new ExtMobileFrontend(); |
56 | 64 | |
57 | 65 | $wgHooks['BeforePageDisplay'][] = array( &$wgExtMobileFrontend, 'beforePageDisplayHTML' ); |
— | — | @@ -76,7 +84,7 @@ |
77 | 85 | } |
78 | 86 | |
79 | 87 | class ExtMobileFrontend { |
80 | | - const VERSION = '0.5.66'; |
| 88 | + const VERSION = '0.5.67'; |
81 | 89 | |
82 | 90 | /** |
83 | 91 | * @var DOMDocument |
— | — | @@ -116,6 +124,7 @@ |
117 | 125 | public static $currentURL; |
118 | 126 | public static $displayNoticeId; |
119 | 127 | public static $leaveFeedbackURL; |
| 128 | + public static $mobileRedirectFormAction; |
120 | 129 | |
121 | 130 | public static $messageKeys = array( |
122 | 131 | 'mobile-frontend-show-button', |
— | — | @@ -216,7 +225,7 @@ |
217 | 226 | } |
218 | 227 | |
219 | 228 | public function getMsg() { |
220 | | - global $wgUser, $wgContLang, $wgRequest; |
| 229 | + global $wgUser, $wgContLang, $wgRequest, $wgServer, $wgMobileRedirectFormAction, $wgMobileDomain; |
221 | 230 | wfProfileIn( __METHOD__ ); |
222 | 231 | |
223 | 232 | self::$disableImagesURL = $wgRequest->escapeAppendQuery( 'disableImages=1' ); |
— | — | @@ -248,6 +257,9 @@ |
249 | 258 | |
250 | 259 | self::$dir = $wgContLang->getDir(); |
251 | 260 | self::$code = $wgContLang->getCode(); |
| 261 | + |
| 262 | + $nonMobileServerBaseURL = str_replace( $wgMobileDomain, '.', $wgServer ); |
| 263 | + self::$mobileRedirectFormAction = ( isset( $wgMobileRedirectFormAction ) ) ? $wgMobileRedirectFormAction : "{$nonMobileServerBaseURL}/w/mobileRedirect.php"; |
252 | 264 | |
253 | 265 | self::$mainPageUrl = Title::newMainPage()->getLocalUrl(); |
254 | 266 | self::$randomPageUrl = $this->getRelativeURL( SpecialPage::getTitleFor( 'Randompage' )->getLocalUrl() ); |
Index: trunk/extensions/MobileFrontend/views/information/disable.html.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -$lang = self::$code; |
5 | 4 | $currentURL = self::$currentURL; |
6 | 5 | $currentURL = str_replace('&mobileaction=disable_mobile_site', '', $currentURL); |
| 6 | +$mobileRedirectFormAction = self::$mobileRedirectFormAction; |
7 | 7 | |
8 | 8 | $disableHtml = <<<EOT |
9 | 9 | <h1> |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | {$explainDisable} |
14 | 14 | </p> |
15 | 15 | <div id='disableButtons'> |
16 | | - <form action='http://{$lang}.wikipedia.org/w/mobileRedirect.php' method='get'> |
| 16 | + <form action='{$mobileRedirectFormAction}' method='get'> |
17 | 17 | <input name='to' type='hidden' value='{$currentURL}' /> |
18 | 18 | <input name='expires_in_days' type='hidden' value='3650' /> |
19 | 19 | <button id='disableButton' type='submit'>{$disableButton}</button> |