Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php |
— | — | @@ -16,6 +16,14 @@ |
17 | 17 | $articleCacheKey = $title->getNamespace().':'.$title->getText(); |
18 | 18 | AFComputedVariable::$articleCache[$articleCacheKey] = $editor->mArticle; |
19 | 19 | |
| 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 | + |
20 | 28 | global $wgUser; |
21 | 29 | $vars->addHolder( AbuseFilter::generateUserVars( $wgUser ) ); |
22 | 30 | $vars->addHolder( AbuseFilter::generateTitleVars( $editor->mTitle , 'ARTICLE' ) ); |
— | — | @@ -23,13 +31,7 @@ |
24 | 32 | $vars->setVar( 'SUMMARY', $summary ); |
25 | 33 | $vars->setVar( 'minor_edit', $editor->minoredit ); |
26 | 34 | |
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 ); |
34 | 36 | $vars->setVar( 'new_wikitext', $text ); |
35 | 37 | |
36 | 38 | $vars->addHolder( AbuseFilter::getEditVars( $editor->mTitle ) ); |