Legoktm has uploaded a new change for review.

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

Change subject: Use Title::getRootText() to get a user's name from Title
......................................................................

Use Title::getRootText() to get a user's name from Title

getBaseText just removes the last subpage, so for something with 2
subpage parts, it would be wrong.

Change-Id: Ia7cb2a3a4ce66c39115d7b7c3b44886ede0d7353
---
M includes/job/MassMessageJob.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/job/MassMessageJob.php b/includes/job/MassMessageJob.php
index f563f20..beee3d5 100644
--- a/includes/job/MassMessageJob.php
+++ b/includes/job/MassMessageJob.php
@@ -145,7 +145,7 @@
                // If we're sending to a User:/User talk: page, make sure the 
user exists.
                // Redirects are automatically followed in getLocalTargets
                if ( $title->getNamespace() === NS_USER || 
$title->getNamespace() === NS_USER_TALK ) {
-                       $user = User::newFromName( $title->getBaseText() );
+                       $user = User::newFromName( $title->getRootText() );
                        if ( !$user || !$user->getId() ) { // Does not exist
                                $this->logLocalSkip( 'skipnouser' );
                                return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7cb2a3a4ce66c39115d7b7c3b44886ede0d7353
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