r68152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68151‎ | r68152 | r68153 >
Date:06:41, 17 June 2010
Author:tstarling
Status:ok
Tags:
Comment:
Reverting r67673, clueless.
Modified paths:
  • /trunk/extensions/WikimediaMobile/MobileRedirect.js (modified) (history)
  • /trunk/extensions/WikimediaMobile/WikimediaMobile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaMobile/WikimediaMobile.php
@@ -24,8 +24,9 @@
2525 /**
2626 * The base URL of the mobile gateway
2727 */
28 -$wgWikimediaMobileUrl = '.m.wikipedia.org';
 28+$wgWikimediaMobileUrl = 'http://en.m.wikipedia.org/wiki';
2929
 30+
3031 $wgHooks['BeforePageDisplay'][] = 'wfWikimediaMobileAddJs';
3132 $wgHooks['MakeGlobalVariablesScript'][] = 'wfWikimediaMobileVars';
3233
Index: trunk/extensions/WikimediaMobile/MobileRedirect.js
@@ -15,10 +15,13 @@
1616
1717 function getMobileUrl() {
1818 var mainPage = wgMainPageTitle.replace(/ /g, '_');
19 - var url = 'http://' + wgContentLanguage + ".m.wikipedia.org/";
20 - if (wgPageName != mainPage) {
21 - url += "wiki/" + encodeURI(wgPageName);
 19+ var url = wgWikimediaMobileUrl + '/';
 20+ if (wgPageName == mainPage) {
 21+ url += '::Home'; // Special case
 22+ } else {
 23+ url += encodeURI(wgPageName);
2224 }
 25+ url += '?wasRedirected=true';
2326 return url;
2427 }
2528

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67673Fixing up the MobileRedirects based on conversation with tomaszhcatlin22:36, 8 June 2010

Status & tagging log