Last modified: 2011-10-27 12:15:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T33656, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31656 - AbuseFilter should extract old_wikitext from the last revision, not from the edited revision
AbuseFilter should extract old_wikitext from the last revision, not from the ...
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
unspecified
All All
: Highest normal with 1 vote (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
: need-integration-test, platformeng
Depends on:
Blocks: 29876
  Show dependency treegraph
 
Reported: 2011-10-12 21:29 UTC by orlodrim
Modified: 2011-10-27 12:15 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description orlodrim 2011-10-12 21:29:12 UTC
Hello,

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
Comment 1 Mark A. Hershberger 2011-10-15 22:03:10 UTC
tagging bugs for Marcus to look at
Comment 2 Antoine "hashar" Musso (WMF) 2011-10-24 22:10:41 UTC
Assigning to self per general engineering meeting. Will either fix it up myself or hand this bug to someone else.
Comment 3 Antoine "hashar" Musso (WMF) 2011-10-25 10:23:49 UTC
r100687 make AbuseFilter skip the edit only if it was made against the latest version.

Still have to investigate the added_lines issue.
Comment 4 Antoine "hashar" Musso (WMF) 2011-10-25 12:46:46 UTC
I have reverted r100687 and did a better patch with r100692.

Bug is now pending code review.
Comment 5 Mark A. Hershberger 2011-10-25 23:19:54 UTC
reviewed and pushed.
Comment 6 orlodrim 2011-10-27 12:12:12 UTC
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)
Comment 7 Antoine "hashar" Musso (WMF) 2011-10-27 12:15:35 UTC
Thanks for the verification orlodrim!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links