mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 14:13:54 +00:00
Merge "Use $user param when filtering edits"
This commit is contained in:
commit
14be09701b
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue