https://www.mediawiki.org/wiki/Special:Code/MediaWiki/109590
Revision: 109590
Author: preilly
Date: 2012-01-20 00:07:41 +0000 (Fri, 20 Jan 2012)
Log Message:
-----------
1.18wmf: MFT r109589
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
2012-01-20 00:05:57 UTC (rev 109589)
+++ branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
2012-01-20 00:07:41 UTC (rev 109590)
@@ -496,6 +496,28 @@
global $wgContLang, $wgRequest, $wgMemc, $wgUser, $wgConf;
wfProfileIn( __METHOD__ );
+ // Note: The WebRequest Class calls are made in this block
because
+ // since PHP 5.1.x, all objects have their destructors called
+ // before the output buffer callback function executes.
+ // Thus, globalized objects will not be available as expected
in the function.
+ // This is stated to be intended behavior, as per the
following: [http://bugs.php.net/bug.php?id=40104]
+
+ $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ?
$_SERVER['HTTP_X_DEVICE'] : '';
+ self::$useFormat = $wgRequest->getText( 'useformat' );
+ $mobileAction = $wgRequest->getText( 'mobileaction' );
+ $action = $wgRequest->getText( 'action' );
+
+ if ( self::$useFormat !== 'mobile' && self::$useFormat !==
'mobile-wap' &&
+ !$xDevice ) {
+ wfProfileOut( __METHOD__ );
+ return true;
+ }
+ if ( $action === 'edit' ||
+ $mobileAction === 'view_normal_site' ) {
+ wfProfileOut( __METHOD__ );
+ return true;
+ }
+
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$acceptHeader = isset( $_SERVER["HTTP_ACCEPT"] ) ?
$_SERVER["HTTP_ACCEPT"] : '';
$uAmd5 = md5( $userAgent );
@@ -524,28 +546,6 @@
// echo $e->getMessage();
}
- // Note: The WebRequest Class calls are made in this block
because
- // since PHP 5.1.x, all objects have their destructors called
- // before the output buffer callback function executes.
- // Thus, globalized objects will not be available as expected
in the function.
- // This is stated to be intended behavior, as per the
following: [http://bugs.php.net/bug.php?id=40104]
-
- $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ?
$_SERVER['HTTP_X_DEVICE'] : '';
- self::$useFormat = $wgRequest->getText( 'useformat' );
- $mobileAction = $wgRequest->getText( 'mobileaction' );
- $action = $wgRequest->getText( 'action' );
-
- if ( self::$useFormat !== 'mobile' && self::$useFormat !==
'mobile-wap' &&
- !$xDevice ) {
- wfProfileOut( __METHOD__ );
- return true;
- }
- if ( $action === 'edit' ||
- $mobileAction === 'view_normal_site' ) {
- wfProfileOut( __METHOD__ );
- return true;
- }
-
self::$title = $out->getTitle();
if ( self::$title->isMainPage() ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs