Legoktm has submitted this change and it was merged.

Change subject: Title::newFromText will return null if the user provides an 
invalid title
......................................................................


Title::newFromText will return null if the user provides an invalid title

If a user provides titles like "[[Main Page]]" or "Main Page :>>", 
Title::newFromText
will return null. Now it will show the same error message as if the page didn't
exist rather than causing a fatal error.

Change-Id: I6a9c7a2f6023f43cb1563b28f8e67d5262dbf61c
---
M SpecialMassMessage.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Legoktm: Verified; Looks good to me, approved



diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php
index 09cd7c7..2c1d115 100644
--- a/SpecialMassMessage.php
+++ b/SpecialMassMessage.php
@@ -138,7 +138,7 @@
                $global = $data['global']; // If the message delivery is global
                $status = new Status();
                $errors = array();
-               if ( $spamlist->getArticleID() == 0 ) {
+               if ( $spamlist === null || $spamlist->getArticleID() == 0 ) {
                        $status->fatal( 'massmessage-spamlist-doesnotexist' );
                }
 

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

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

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

Reply via email to