Merge "Use $user param when filtering edits"

This commit is contained in:
jenkins-bot 2020-08-20 07:10:52 +00:00 committed by Gerrit Code Review
commit 14be09701b

View file

@ -107,7 +107,7 @@ class AbuseFilterHooks {
) {
$startTime = microtime( true );
$filterResult = self::filterEdit( $context, $content, $summary, $slot );
$filterResult = self::filterEdit( $context, $user, $content, $summary, $slot );
if ( !$filterResult->isOK() ) {
// Produce a useful error message for API edits
@ -122,12 +122,16 @@ class AbuseFilterHooks {
* Implementation for EditFilterMergedContent hook.
*
* @param IContextSource $context the context of the edit
* @param User $user
* @param Content $content the new Content generated by the edit
* @param string $summary Edit summary for page
* @param string $slot slot role for the content
* @return Status
*/
public static function filterEdit( IContextSource $context, Content $content,
public static function filterEdit(
IContextSource $context,
User $user,
Content $content,
$summary, $slot = SlotRecord::MAIN
) : Status {
self::$lastEditPage = null;
@ -143,7 +147,6 @@ class AbuseFilterHooks {
return Status::newGood();
}
$user = $context->getUser();
if ( $title->canExist() && $title->exists() ) {
// Make sure we load the latest text saved in database (bug 31656)
$page = $context->getWikiPage();