http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97881
Revision: 97881
Author: preilly
Date: 2011-09-23 01:08:41 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
mft r97879
Modified Paths:
--------------
branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
Modified: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
2011-09-23 01:08:28 UTC (rev 97880)
+++ branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
2011-09-23 01:08:41 UTC (rev 97881)
@@ -84,7 +84,7 @@
}
class ExtMobileFrontend {
- const VERSION = '0.5.68';
+ const VERSION = '0.5.70';
/**
* @var DOMDocument
@@ -200,9 +200,12 @@
);
public function testCanonicalRedirect( $request, $title, $output ) {
- global $wgMobileDomain;
- $host = $request->getHeader( 'HOST' );
- return !( stristr( $host, $wgMobileDomain ) !== false );
+ $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ?
$_SERVER['HTTP_X_DEVICE'] : '';
+ if ( empty( $xDevice ) ) {
+ return true; // Let the redirect happen
+ } else {
+ return false; // Prevent the redirect from occuring
+ }
}
public function addMobileFooter( &$obj, &$tpl ) {
@@ -216,7 +219,7 @@
$footerlinks = $tpl->data['footerlinks'];
$mobileViewUrl = $wgRequest->escapeAppendQuery(
'useformat=mobile' );
- $tpl->set('mobileview', "<a
href='{$mobileViewUrl}'>".wfMsg( 'mobile-frontend-view')."</a>");
+ $tpl->set('mobileview', "<a href='{$mobileViewUrl}'>" .
wfMsg( 'mobile-frontend-view' ) . "</a>");
$footerlinks['places'][] = 'mobileview';
$tpl->set('footerlinks', $footerlinks);
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs