Page MenuHomePhabricator

AbuseFilter should extract old_wikitext from the last revision, not from the edited revision
Closed, ResolvedPublic



When an old revision of a page is selected in the history, edited and published, it seems that AbuseFilter initializes old_wikitext with the text of this old revision instead of the last published revision before the current edit (this also affects related variables such as added_lines).

Moreover, when an old revision is edited and published without any change, the edit is not filtered at all (because of the test "if ( strcmp( $oldtext, $text ) == 0 ) ... return true;" in the function onEditFilterMerged of AbuseFilter.hooks.php, I guess).

This makes possible to circumvent any filter as soon as a "bad" revision exists in the page history. Moreover, it is hard to understand afterwards why such edits are not filtered, as they trigger filters normally in the test interface.

Best regards

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 21 2014, 11:55 PM
bzimport set Reference to bz31656.

Assigning to self per general engineering meeting. Will either fix it up myself or hand this bug to someone else.

r100687 make AbuseFilter skip the edit only if it was made against the latest version.

Still have to investigate the added_lines issue.

I have reverted r100687 and did a better patch with r100692.

Bug is now pending code review.

Thank you, it works now. This might also solve bug 28154 (At least the issue mentionned in bug 28154, comment 2. I cannot check the history of the page given in the bug description)

Thanks for the verification orlodrim!