mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Handle EditFilterMergedContent hook properly to break hook chains and display error message"
This commit is contained in:
commit
eb24f02c25
|
@ -28,6 +28,7 @@ class AbuseFilterHooks {
|
|||
* @param User $user the user performing the edit
|
||||
* @param bool $minoredit whether this is a minor edit according to the user.
|
||||
* @param string $slot slot role for the content
|
||||
* @return bool
|
||||
*/
|
||||
public static function onEditFilterMergedContent( IContextSource $context, Content $content,
|
||||
Status $status, $summary, User $user, $minoredit, $slot = SlotRecord::MAIN
|
||||
|
@ -48,9 +49,13 @@ class AbuseFilterHooks {
|
|||
// Produce a useful error message for API edits
|
||||
$filterResultApi = self::getApiStatus( $filterResult );
|
||||
$status->merge( $filterResultApi );
|
||||
// @todo Remove this line after this extension do not support mediawiki version 1.36 and before
|
||||
$status->value = \EditPage::AS_HOOK_ERROR_EXPECTED;
|
||||
}
|
||||
MediaWikiServices::getInstance()->getStatsdDataFactory()
|
||||
->timing( 'timing.editAbuseFilter', microtime( true ) - $startTime );
|
||||
|
||||
return $status->isOK();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue