mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Fix user talk exception for blacklist
There was a null-dereference for events without titles. Also, it should only whitelist their own user talk space, not e.g. mentions on someone else's user talk space. Bug: T150419 Bug: T166627 Change-Id: If7d9cad4eb33ce1f1e6b7d86244332ad5dece954
This commit is contained in:
parent
8b6191088e
commit
813ab5b54e
|
@ -433,7 +433,19 @@ class EchoNotificationController {
|
|||
|
||||
// Apply blacklists and whitelists.
|
||||
$notify->addFilter( function ( $user ) use ( $event ) {
|
||||
if ( self::isBlacklistedByUser( $event, $user ) && $event->getTitle()->getNamespace() !== NS_USER_TALK ) {
|
||||
$title = $event->getTitle();
|
||||
|
||||
if ( self::isBlacklistedByUser( $event, $user ) &&
|
||||
(
|
||||
$title === null ||
|
||||
!(
|
||||
// Still notify for posts anywhere in
|
||||
// user's talk space
|
||||
$title->getRootText() === $user->getName() &&
|
||||
$title->getNamespace() === NS_USER_TALK
|
||||
)
|
||||
)
|
||||
) {
|
||||
return self::isWhitelistedByUser( $event, $user );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue