Legoktm has uploaded a new change for review.

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


Change subject: If the spamlist is a redirect, follow it. If it's an interwiki 
redirect, throw an error.
......................................................................

If the spamlist is a redirect, follow it. If it's an interwiki redirect, throw 
an error.

Change-Id: Iee96ccd1598ce7202b6467cd2e8e66d86dd44985
---
M SpecialMassMessage.php
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/73/75073/1

diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php
index 513921a..e7578f4 100644
--- a/SpecialMassMessage.php
+++ b/SpecialMassMessage.php
@@ -142,6 +142,17 @@
                        $status->fatal( 'massmessage-spamlist-doesnotexist' );
                }
 
+               // Follow a redirect if possible
+               $wikipage = WikiPage::factory( $spamlist );
+               if ( $wikipage->getRedirectTarget() !== null ) {
+                       $target = $wikipage->followRedirect();
+                       if ( $target instanceof Title ) {
+                               $spamlist = $target;
+                       } else {
+                               $status->fatal( 
'massmessage-spamlist-doesnotexist' ); // Interwiki redirect.
+                       }
+               }
+
                // Check that our account hasn't been blocked.
                $user = MassMessage::getMessengerUser();
                if ( !$global && $user->isBlocked() ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee96ccd1598ce7202b6467cd2e8e66d86dd44985
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to