diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index d00407afd..859ad8692 100755 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -20,6 +20,12 @@ class AbuseFilterHooks { * @return bool */ public static function onAPIEditBeforeSave( $editPage, $text, &$result ) { + if ( $editPage->undidRev > 0 ) { + // This hook is also (unlike the non-API hooks) being run on undo, + // but we don't want to filter in that case. T126861 + return true; + } + $context = $editPage->mArticle->getContext(); $status = Status::newGood();