r100687 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100686‎ | r100687 | r100688 >
Date:10:22, 25 October 2011
Author:hashar
Status:reverted
Tags:
Comment:
(bug 31656) AbuseFilter skips non null edits

This bug is triggering when a user submit an old revision again. AbuseFilter
considered it to be a null edit although the old revision is certainly
a different text than the current one in the database.

This patch make sure we skip filtering only if we will be comparing with the
lastest content.

Follow up r52740
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php
@@ -29,11 +29,14 @@
3030 $oldtext = '';
3131
3232 if ( $editor->mArticle->exists() ) {
 33+ // Fetch text which might be an old revision
3334 $oldtext = $editor->mArticle->getContent();
3435 }
3536
36 - if ( strcmp( $oldtext, $text ) == 0 ) {
37 - // Don't trigger for null edits.
 37+ if ( $editor->mArticle->isCurrent() && strcmp( $oldtext, $text ) == 0) {
 38+ // Do not trigger if used text was the latest in the database and user
 39+ // submitted text does not introduce any difference.
 40+ // See bugs 19267 & 31656.
3841 return true;
3942 }
4043

Follow-up revisions

RevisionCommit summaryAuthorDate
r100691revert r100687hashar12:12, 25 October 2011
r100692(bug 31656) AbuseFilter skips non null edits...hashar12:46, 25 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52740Don't trigger AbuseFilter for null edits, bug 19267werdna14:01, 3 July 2009

Status & tagging log