r67673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67672‎ | r67673 | r67674 >
Date:22:36, 8 June 2010
Author:hcatlin
Status:reverted (Comments)
Tags:
Comment:
Fixing up the MobileRedirects based on conversation with tomasz
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,9 +24,8 @@
2525 /**
2626 * The base URL of the mobile gateway
2727 */
28 -$wgWikimediaMobileUrl = 'http://en.m.wikipedia.org/wiki';
 28+$wgWikimediaMobileUrl = '.m.wikipedia.org';
2929
30 -
3130 $wgHooks['BeforePageDisplay'][] = 'wfWikimediaMobileAddJs';
3231 $wgHooks['MakeGlobalVariablesScript'][] = 'wfWikimediaMobileVars';
3332
Index: trunk/extensions/WikimediaMobile/MobileRedirect.js
@@ -15,13 +15,10 @@
1616
1717 function getMobileUrl() {
1818 var mainPage = wgMainPageTitle.replace(/ /g, '_');
19 - var url = wgWikimediaMobileUrl + '/';
20 - if (wgPageName == mainPage) {
21 - url += '::Home'; // Special case
22 - } else {
23 - url += encodeURIComponent(wgPageName).replace('%2F','/').replace('%3A',':');
 19+ var url = 'http://' + wgContentLanguage + ".m.wikipedia.org/";
 20+ if (wgPageName != mainPage) {
 21+ url += "wiki/" + encodeURIComponent(wgPageName).replace('%2F','/').replace('%3A',':');
2422 }
25 - url += '?wasRedirected=true';
2623 return url;
2724 }
2825

Follow-up revisions

RevisionCommit summaryAuthorDate
r68152Reverting r67673, clueless.tstarling06:41, 17 June 2010

Comments

#Comment by Tim Starling (talk | contribs)   06:32, 17 June 2010

I thought I explained this using small simple words when I told you about this extension on IRC. The URL is configured by CommonSettings.php. The fact that the language is in the URL is Wikimedia-specific and has no place in a Wikimedia extension. I'm reverting this.

Status & tagging log