mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-11-24 07:04:04 +00:00
Handle EditFilterMergedContent hook properly to break hook chains and display error message
Extensions are supposed to return false to break hook chains when failed, which can avoid unnecessary call of later handlers in other extensions and work around with problems caused by difference betwen multiple triggers. On mediawiki version 1.36 and before, just returning false in this hook can't display error message by default. Set $status->value manually still to provide backward compatibility. Bug: T280312 Change-Id: I456a40ce676c486b4ae12f00a7024a4c070448cd
This commit is contained in:
parent
32ea1e7596
commit
d4dd5a9408
|
@ -61,9 +61,11 @@ class SpamBlacklistHooks implements
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$status->fatal( $error );
|
$status->fatal( $error );
|
||||||
|
// @todo Remove this line after this extension do not support mediawiki version 1.36 and before
|
||||||
|
$status->value = EditPage::AS_HOOK_ERROR_EXPECTED;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always return true, EditPage will look at $status->isOk().
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue