Don't ping from user talk links in summary

As discussed at T189034

Change-Id: I86f36ab55c0e03ba3bbd2ea1ee94ce3056d91e30
This commit is contained in:
Max Semenik 2018-03-08 14:36:58 -08:00
parent c63f321cae
commit 6f6e5062fe
2 changed files with 2 additions and 1 deletions

View file

@ -39,7 +39,7 @@ class EchoSummaryParser {
$title = Title::newFromText( $match ); $title = Title::newFromText( $match );
if ( $title if ( $title
&& $title->isLocal() && $title->isLocal()
&& ( $title->getNamespace() === NS_USER || $title->getNamespace() == NS_USER_TALK ) && $title->getNamespace() === NS_USER
) { ) {
$user = User::newFromName( $title->getText() ); $user = User::newFromName( $title->getText() );
$lookup = $this->userLookup; $lookup = $this->userLookup;

View file

@ -50,6 +50,7 @@ class EchoSummaryParserTest extends MediaWikiTestCase {
[ '[[:|test]]', [] ], [ '[[:|test]]', [] ],
[ '[[User:Nonexistent]]', [] ], [ '[[User:Nonexistent]]', [] ],
[ '/* [[User:Werdna */', [] ], [ '/* [[User:Werdna */', [] ],
[ '[[User talk:Werdna]]', [] ],
[ '[[User:Werdna]]', [ 'Werdna' ] ], [ '[[User:Werdna]]', [ 'Werdna' ] ],
[ 'this is [[ [[User:Werdna]] ]]', [ 'Werdna' ] ], [ 'this is [[ [[User:Werdna]] ]]', [ 'Werdna' ] ],
[ '[[User:Werdna|]]', [ 'Werdna' ] ], [ '[[User:Werdna|]]', [ 'Werdna' ] ],