r106290 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106289‎ | r106290 | r106291 >
Date:00:26, 15 December 2011
Author:preilly
Status:deferred
Tags:mobile 
Comment:
test for xDevice header
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -423,9 +423,9 @@
424424
425425 public function beforePageRedirect( $out, &$redirect, &$code ) {
426426 if ( $out->getTitle()->isSpecial( 'Userlogin' ) ) {
427 - global $wgMobileDomain, $wgRequest;
428 - $requestURL = $wgRequest->getFullRequestURL();
429 - if ( stristr( $requestURL, $wgMobileDomain ) !== false ) {
 427+ global $wgMobileDomain;
 428+ $xDevice = isset( $_SERVER['HTTP_X_DEVICE'] ) ? $_SERVER['HTTP_X_DEVICE'] : '';
 429+ if ( $xDevice ) {
430430 $parsedUrl = wfParseUrl( $redirect );
431431 if ( stristr( $parsedUrl['host'], $wgMobileDomain ) === false ) {
432432 $hostParts = explode( '.', $parsedUrl['host'] );

Status & tagging log