r105206 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105205‎ | r105206 | r105207 >
Date:19:05, 5 December 2011
Author:preilly
Status:ok
Tags:
Comment:
fix use of __toString to check if is Userlogin
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -88,7 +88,7 @@
8989 }
9090
9191 class ExtMobileFrontend {
92 - const VERSION = '0.5.89';
 92+ const VERSION = '0.5.90';
9393
9494 /**
9595 * @var DOMDocument
@@ -586,7 +586,7 @@
587587 $this->sendApplicationVersionVaryHeader();
588588 $this->checkUserStatus();
589589
590 - if ( self::$title == 'Special:UserLogin' && self::$isBetaGroupMember ) {
 590+ if ( self::$title->isSpecial( 'Userlogin' ) && self::$isBetaGroupMember ) {
591591 self::$wsLoginToken = $wgRequest->getSessionData( 'wsLoginToken' );
592592 $returnToVal = $wgRequest->getVal( 'returnto' );
593593 $returnto = ( !empty( $returnToVal ) ) ? '&returnto=' . wfUrlencode( $returnToVal ) : '';
@@ -1182,7 +1182,7 @@
11831183 $logoutHtml = $this->doc->saveXML( $ptLogoutLink, LIBXML_NOEMPTYTAG );
11841184 }
11851185
1186 - if ( self::$title == 'Special:UserLogin' && self::$isBetaGroupMember ) {
 1186+ if ( self::$title->isSpecial( 'Userlogin' ) && self::$isBetaGroupMember ) {
11871187 $userlogin = $this->doc->getElementById( 'userloginForm' );
11881188
11891189 if ( !empty( $userlogin ) && get_class($userlogin) === 'DOMElement' ) {
@@ -1275,7 +1275,7 @@
12761276 $redLink->parentNode->replaceChild( $spanNode, $redLink );
12771277 }
12781278
1279 - if ( self::$title == 'Special:UserLogin' && self::$isBetaGroupMember ) {
 1279+ if ( self::$title->isSpecial( 'Userlogin' ) && self::$isBetaGroupMember ) {
12801280 if ( !empty( $userlogin ) && get_class($userlogin) === 'DOMElement' ) {
12811281 $login = $this->renderLogin();
12821282 $loginNode = $this->doc->importNode( $login, true );

Follow-up revisions

RevisionCommit summaryAuthorDate
r1052071.18wmf1: MFT r105206preilly19:07, 5 December 2011
r1053371.18wmf1: MFT r105206 - r105333preilly19:28, 6 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104518remove unnecessary dom parsingpreilly00:21, 29 November 2011

Status & tagging log