r52740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52739‎ | r52740 | r52741 >
Date:14:01, 3 July 2009
Author:werdna
Status:deferred
Tags:
Comment:
Don't trigger AbuseFilter for null edits, bug 19267
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php
@@ -16,6 +16,14 @@
1717 $articleCacheKey = $title->getNamespace().':'.$title->getText();
1818 AFComputedVariable::$articleCache[$articleCacheKey] = $editor->mArticle;
1919
 20+ // Check for null edits.
 21+ $oldtext = $editor->mArticle->getContent();
 22+
 23+ if ( strcmp( $oldtext, $text ) == 0 ) {
 24+ // Don't trigger for null edits.
 25+ return true;
 26+ }
 27+
2028 global $wgUser;
2129 $vars->addHolder( AbuseFilter::generateUserVars( $wgUser ) );
2230 $vars->addHolder( AbuseFilter::generateTitleVars( $editor->mTitle , 'ARTICLE' ) );
@@ -23,13 +31,7 @@
2432 $vars->setVar( 'SUMMARY', $summary );
2533 $vars->setVar( 'minor_edit', $editor->minoredit );
2634
27 - $vars->setLazyLoadVar( 'old_wikitext', 'revision-text-by-timestamp',
28 - array(
29 - 'timestamp' => $editor->edittime,
30 - 'namespace' => $editor->mTitle->getNamespace(),
31 - 'title' => $editor->mTitle->getText(),
32 - ) );
33 -
 35+ $vars->setVar( 'old_wikitext', $oldtext );
3436 $vars->setVar( 'new_wikitext', $text );
3537
3638 $vars->addHolder( AbuseFilter::getEditVars( $editor->mTitle ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r100687(bug 31656) AbuseFilter skips non null edits...hashar10:22, 25 October 2011
r100692(bug 31656) AbuseFilter skips non null edits...hashar12:46, 25 October 2011

Status & tagging log