r91117 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91116‎ | r91117 | r91118 >
Date:21:55, 29 June 2011
Author:preilly
Status:deferred
Tags:
Comment:
remove mobile view from generic devices
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -51,7 +51,7 @@
5252 'addMobileFooter' );
5353
5454 class ExtMobileFrontend {
55 - const VERSION = '0.5.4';
 55+ const VERSION = '0.5.5';
5656
5757 private $doc;
5858
@@ -156,7 +156,13 @@
157157 $wurflManager = $wurflManagerFactory->create();
158158 $device = $wurflManager->getDeviceForHttpRequest( $_SERVER );
159159 $props = $device->getAllCapabilities();
160 - $wgMemc->set( $key, $props, 86400 );
 160+
 161+ if ( $device->isSpecific() === true ) {
 162+ $wgMemc->set( $key, $props, 86400 );
 163+ } else {
 164+ $wgMemc->set( $key, "generic", 86400 );
 165+ $props = "generic";
 166+ }
161167 }
162168 } catch (Exception $e) {
163169 //echo $e->getMessage();
@@ -197,7 +203,8 @@
198204 }
199205 }
200206
201 - if ( $mAction != 'view_normal_site' &&
 207+ if ( is_array($props) &&
 208+ $mAction != 'view_normal_site' &&
202209 $props['is_wireless_device'] === 'true' &&
203210 $props['is_tablet'] === 'false' ) {
204211 ob_start( array( $this, 'DOMParse' ) );

Status & tagging log