r48008 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48007‎ | r48008 | r48009 >
Date:01:56, 4 March 2009
Author:werdna
Status:ok
Tags:
Comment:
(bug 17664) Handle section-editing correctly by switching from EditFilter to EditFilterMerged.
Also, fix a weird bug where the Abuse Filter was diffing the parsed text, not the wikitext
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.hooks.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.php
@@ -53,7 +53,7 @@
5454 $wgSpecialPageGroups['AbuseLog'] = 'changes';
5555 $wgSpecialPageGroups['AbuseFilter'] = 'wiki';
5656
57 -$wgHooks['EditFilter'][] = 'AbuseFilterHooks::onEditFilter';
 57+$wgHooks['EditFilterMerged'][] = 'AbuseFilterHooks::onEditFilterMerged';
5858 $wgHooks['GetAutoPromoteGroups'][] = 'AbuseFilterHooks::onGetAutoPromoteGroups';
5959 $wgHooks['AbortMove'][] = 'AbuseFilterHooks::onAbortMove';
6060 $wgHooks['AbortNewAccount'][] = 'AbuseFilterHooks::onAbortNewAccount';
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -1158,7 +1158,7 @@
11591159 $article = new Article( $title );
11601160
11611161 $vars->setLazyLoadVar( 'edit_diff', 'diff',
1162 - array( 'oldtext-var' => 'old_text', 'newtext-var' => 'new_text' ) );
 1162+ array( 'oldtext-var' => 'old_wikitext', 'newtext-var' => 'new_wikitext' ) );
11631163 $vars->setLazyLoadVar( 'new_size', 'length', array( 'length-var' => 'new_wikitext' ) );
11641164 $vars->setLazyLoadVar( 'old_size', 'length', array( 'length-var' => 'old_wikitext' ) );
11651165 $vars->setLazyLoadVar( 'edit_delta', 'subtract',
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php
@@ -7,7 +7,7 @@
88 // So far, all of the error message out-params for these hooks accept HTML.
99 // Hooray!
1010
11 - public static function onEditFilter($editor, $text, $section, &$error, $summary) {
 11+ public static function onEditFilterMerged($editor, $text, &$error, $summary) {
1212 // Load vars
1313 $vars = new AbuseFilterVariableHolder;
1414

Follow-up revisions

RevisionCommit summaryAuthorDate
r48496Really fix bug 17664 by switching from $editor->textbox1 (which of course con...vasilievvv20:44, 17 March 2009

Status & tagging log