Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89108


Change subject: Don't try to watch special pages after a successful CTA
......................................................................

Don't try to watch special pages after a successful CTA

Also add protection against it happening.
This was previously happening when clicking sign up from login CTA
and then clicking login from the left menu
Bug: 55379

Change-Id: Ib295ad025c813ed4def2186acb974ecdde9e620a
---
M includes/MobileFrontend.hooks.php
M includes/skins/SkinMobile.php
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/08/89108/1

diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 8acfbb5..aa803ed 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -423,7 +423,8 @@
                $watch = $context->getRequest()->getVal( 'watch' );
                if ( !is_null( $watch ) ) {
                        $title = Title::newFromText( $watch );
-                       if ( !is_null( $title ) ) {
+                       // protect against watching special pages (these cannot 
be watched!)
+                       if ( !is_null( $title ) && !$title->isSpecialPage() ) {
                                WatchAction::doWatch( $title, $currentUser );
                        }
                }
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index e064e45..85a1242 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -438,7 +438,12 @@
                        unset( $returntoquery['returnto'] );
                        unset( $returntoquery['returntoquery'] );
                }
-               $query[ 'returnto' ] = $this->getTitle()->getPrefixedText();
+               $title = $this->getTitle();
+               // Don't ever redirect back to the login page (bug 55379)
+               if ( !$title->isSpecial( 'Userlogin' ) ) {
+                       $query[ 'returnto' ] = $title->getPrefixedText();
+               }
+
                if ( $this->getUser()->isLoggedIn() ) {
                        if ( !empty( $returntoquery ) ) {
                                $query[ 'returntoquery' ] = wfArrayToCgi( 
$returntoquery );

-- 
To view, visit https://gerrit.wikimedia.org/r/89108
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib295ad025c813ed4def2186acb974ecdde9e620a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to