diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 032706e34..e1ee04165 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -2077,7 +2077,6 @@ class AbuseFilter { $vars->setVar( 'ACTION', 'edit' ); $vars->setVar( 'SUMMARY', $row->rc_comment ); - $vars->setVar( 'minor_edit', $row->rc_minor ); $vars->setLazyLoadVar( 'new_wikitext', 'revision-text-by-id', array( 'revid' => $row->rc_this_oldid ) ); diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index 92c9a72ad..1fb86883e 100644 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -114,7 +114,7 @@ class AbuseFilterHooks { // Load vars for filters to check $vars = self::newVariableHolderForEdit( - $user, $title, $page, $summary, $minoredit, $oldtext, $text + $user, $title, $page, $summary, $oldtext, $text ); $filter_result = AbuseFilter::filterAction( $vars, $title ); @@ -135,14 +135,13 @@ class AbuseFilterHooks { * @param Title $title * @param WikiPage|null $page * @param string $summary - * @param bool $minoredit * @param string $oldtext * @param string $text * @return AbuseFilterVariableHolder * @throws MWException */ private static function newVariableHolderForEdit( - User $user, Title $title, $page, $summary, $minoredit, $oldtext, $text + User $user, Title $title, $page, $summary, $oldtext, $text ) { $vars = new AbuseFilterVariableHolder(); $vars->addHolders( @@ -151,7 +150,6 @@ class AbuseFilterHooks { ); $vars->setVar( 'action', 'edit' ); $vars->setVar( 'summary', $summary ); - $vars->setVar( 'minor_edit', $minoredit ); $vars->setVar( 'old_wikitext', $oldtext ); $vars->setVar( 'new_wikitext', $text ); // TODO: set old_content and new_content vars, use them @@ -801,14 +799,8 @@ class AbuseFilterHooks { // Do this outside the synchronous stash lock to avoid any chance of slowdown. DeferredUpdates::addCallableUpdate( function () use ( $user, $page, $summary, $oldtext, $text ) { - // Case A: if the edit turns out to be non-minor $vars = self::newVariableHolderForEdit( - $user, $page->getTitle(), $page, $summary, false, $oldtext, $text - ); - AbuseFilter::filterAction( $vars, $page->getTitle(), 'default', $user, 'stash' ); - // Case B: if the edit turns out to be minor - $vars = self::newVariableHolderForEdit( - $user, $page->getTitle(), $page, $summary, true, $oldtext, $text + $user, $page->getTitle(), $page, $summary, $oldtext, $text ); AbuseFilter::filterAction( $vars, $page->getTitle(), 'default', $user, 'stash' ); }, diff --git a/AbuseFilterVariableHolder.php b/AbuseFilterVariableHolder.php index 34a8c9854..f93ec5907 100644 --- a/AbuseFilterVariableHolder.php +++ b/AbuseFilterVariableHolder.php @@ -4,6 +4,11 @@ class AbuseFilterVariableHolder { public static $varBlacklist = array( 'context' ); + public function __construct() { + // Backwards-compatibility (unused now) + $this->setVar( 'minor_edit', false ); + } + /** * @param $variable * @param $datum