r94182 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94181‎ | r94182 | r94183 >
Date:18:52, 10 August 2011
Author:preilly
Status:ok
Tags:
Comment:
add trigger for mobile view based on x-device header set by varnish
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -49,7 +49,7 @@
5050 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
5151
5252 class ExtMobileFrontend {
53 - const VERSION = '0.5.12';
 53+ const VERSION = '0.5.13';
5454
5555 /**
5656 * @var DOMDocument
@@ -319,9 +319,12 @@
320320 // html_preferred_dtd
321321
322322 // Determine
 323+
 324+ $xDevice = $_SERVER['HTTP_X_DEVICE'];
323325
324326 if (self::$useFormat === 'mobile' ||
325 - self::$useFormat === 'mobile-wap' ) {
 327+ self::$useFormat === 'mobile-wap' ||
 328+ isset( $xDevice) ) {
326329 $this->getMsg();
327330 $this->disableCaching();
328331 ob_start( array( $this, 'DOMParse' ) );

Status & tagging log