Last modified: 2013-07-16 15:04:37 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 T53403, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51403 - AbuseFilter: API is responding with wikitext instead of HTML in the "warning" property
AbuseFilter: API is responding with wikitext instead of HTML in the "warning"...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 50472
  Show dependency treegraph
 
Reported: 2013-07-15 22:17 UTC by Krinkle
Modified: 2013-07-16 15:04 UTC (History)
7 users (show)

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


Attachments
Screenshot of problem in local VisualEditor dev (231.86 KB, image/png)
2013-07-15 22:17 UTC, Krinkle
Details

Description Krinkle 2013-07-15 22:17:40 UTC
Created attachment 12853 [details]
Screenshot of problem in local VisualEditor dev

The code [1] is using $status->getHtml() but apparently it doesn't work as expected because I'm getting raw wikitext.

        "edit": {
            "code": "abusefilter-warning",
            "info": "Hit AbuseFilter: Blanking articles",
            "warning": "'''Warning:''' This action has been automatically identified as harmful.\nUnconstructive edits will be quickly reverted,\nand egregious or repeated unconstructive editing will result in your account or IP address being blocked.\nIf you believe this action to be constructive, you may submit it again to confirm it.\nA brief description of the abuse rule which your action matched is: Blanking articles",
            "result": "Failure"
        }

To import the filter, use "Special:AbuseFilter/import" on your localwiki with:

{"row":{"af_id":"1","af_pattern":"!\"autoconfirmed\" in user_groups\r\n& new_size < 50\r\n& old_size > 500\r\n& article_namespace == 0","af_user":"1","af_user_text":"Root","af_timestamp":"20130715214820","af_enabled":"1","af_comments":"","af_public_comments":"Blanking articles","af_hidden":"0","af_hit_count":"9","af_throttled":"1","af_deleted":"0","af_actions":"warn,disallow,tag","af_global":"0","af_group":"default"},"actions":{"disallow":{"action":"disallow","parameters":[""]},"tag":{"action":"tag","parameters":["blanking"]},"warn":{"action":"warn","parameters":["abusefilter-warning"]}}}



[1] https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/blob/a6b1dade840841ff7adf2ff289b6428f930d6796/AbuseFilter.hooks.php#L22-L57
Comment 1 Marius Hoch 2013-07-15 22:42:23 UTC
That's because Status::getHTML isn't actually doing real parsing... going to look at this tomorrow
Comment 2 kwwilliams 2013-07-15 22:55:26 UTC
I don't think this is really what people want to be doing (regardless of whether HTML is being presented by this call or not). Take a look at filter 554 on English Wikipedia (http://en.wikipedia.org/wiki/Special:AbuseFilter/554). Note how it triggers a message of abusefilter-top100. That causes the standard wikitext editor to display http://en.wikipedia.org/w/index.php?title=MediaWiki:abusefilter-top100 which explains what's wrong with the edit. That's what you need to display, not the short description (in this case "top100 blog charts", which doesn't mean squat to a new editor).
Comment 3 Gerrit Notification Bot 2013-07-15 23:00:26 UTC
Change 73895 had a related patch set uploaded by Hoo man:
Really parse the API warning in the APIEditBeforeSave hook

https://gerrit.wikimedia.org/r/73895
Comment 4 Marius Hoch 2013-07-15 23:23:25 UTC
(In reply to comment #2)
> I don't think this is really what people want to be doing (regardless of
> whether HTML is being presented by this call or not). Take a look at filter
> 554
> on English Wikipedia (http://en.wikipedia.org/wiki/Special:AbuseFilter/554).
> Note how it triggers a message of abusefilter-top100. That causes the
> standard
> wikitext editor to display
> http://en.wikipedia.org/w/index.php?title=MediaWiki:abusefilter-top100 which
> explains what's wrong with the edit. That's what you need to display, not the
> short description (in this case "top100 blog charts", which doesn't mean
> squat
> to a new editor).

That's exactly what we're trying to do.
Comment 5 Marius Hoch 2013-07-15 23:25:26 UTC
(Sorry, if my last comment was unlcear:) Showing the full warning message, I mean.
Comment 6 Gerrit Notification Bot 2013-07-16 03:23:41 UTC
Change 73895 merged by jenkins-bot:
Really parse the API warning in the APIEditBeforeSave hook

https://gerrit.wikimedia.org/r/73895
Comment 7 James Forrester 2013-07-16 15:04:37 UTC
We will deploy this fix today.

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


Navigation
Links