Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -423,9 +423,9 @@ |
424 | 424 | |
425 | 425 | public function beforePageRedirect( $out, &$redirect, &$code ) { |
426 | 426 | 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 ) { |
430 | 430 | $parsedUrl = wfParseUrl( $redirect ); |
431 | 431 | if ( stristr( $parsedUrl['host'], $wgMobileDomain ) === false ) { |
432 | 432 | $hostParts = explode( '.', $parsedUrl['host'] ); |
— | — | @@ -1331,6 +1331,10 @@ |
1332 | 1332 | } |
1333 | 1333 | |
1334 | 1334 | $ptAnonLogin = $this->doc->getElementById( 'pt-anonlogin' ); |
| 1335 | + |
| 1336 | + if ( !$ptAnonLogin ) { |
| 1337 | + $ptAnonLogin = $this->doc->getElementById( 'pt-login' ); |
| 1338 | + } |
1335 | 1339 | |
1336 | 1340 | if ( $ptAnonLogin ) { |
1337 | 1341 | $ptAnonLoginLink = $ptAnonLogin->firstChild; |