Last modified: 2013-07-16 23:07:14 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 T52826, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50826 - VisualEditor: Add support for spam blacklist errors in save dialog
VisualEditor: Add support for spam blacklist errors in save dialog
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
MediaWiki integration (Other open bugs)
unspecified
All All
: High major
: VE-deploy-2013-07-18
Assigned To: Krinkle
:
: 51139 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-05 19:49 UTC by Oliver Keyes
Modified: 2013-07-16 23:07 UTC (History)
7 users (show)

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


Attachments
Developer console dump (169.83 KB, image/jpeg)
2013-07-10 22:32 UTC, Roan Kattouw
Details

Description Oliver Keyes 2013-07-05 19:49:54 UTC
If a user hits the spam blacklist they VE responds merely by informing them "Error: Invalid error code". This is...not helpful.
Comment 1 James Forrester 2013-07-10 22:25:39 UTC
*** Bug 51139 has been marked as a duplicate of this bug. ***
Comment 2 Roan Kattouw 2013-07-10 22:32:20 UTC
Created attachment 12821 [details]
Developer console dump

A very helpful user in #wikipedia-en-help gave me this screenshot of what we get back from the API when TitleBlacklist rejects an edit.
Comment 3 Joe Decker 2013-07-16 05:29:28 UTC
Sounds like y'all have screen shots, but for those of us playing the home game, when I press "Save Page" on a blacklist-blocked edit, that window (with the edit summary, etc.) stays up, and "Error: Unknown error" appears below the edit summary box, to the left of and slightly higher than the Review your edits/Save page buttons--the latter inactive.

MacOSX/Chrome 28.0.1500.71, tested with an examiner.com URL at [[Chad Griffin]] with an incognito window/logged out.
Comment 4 Krinkle 2013-07-16 13:58:17 UTC
So we get the matched url from the API. Ideally we'd get a usable message as well.

Given the following sample (and latest mediawiki/core and SpamBlacklist configured with [[m:Spam_blacklist]])


* [http://cl.ly/foo/?bar=%22%3Equ%3Cb%3Eu%3C%2Fb%3Ex%3Ca%20href%3D%22 d]
* [http://fidosoft.de fidosoft]

index.php?action=submit gives the following:

> The text you wanted to save was blocked by the spam filter. This is probably caused by a link to a blacklisted external site.
> The following text is what triggered our spam filter: http://fidosoft.de and http://cl.ly

These are constructed in EditPage::spamPageWithContent by the "spamprotectiontext" and "spamprotectionmatch" messages respectively, which are actually in mediawiki core. The latter message takes $1 as parameter and EditPage.php sets that to the result of Language::listToText( Array ).

The API gives:

        "edit": {
            "spamblacklist": "http://cl.ly",
            "result": "Failure"
        }

For some reason it isn't getting the second url? The SpamBlacklist API hook looks like it is doing `implode( '|', Array )` but aside from an array being nicer than a pipe-separated list, we're not getting either. Only the first url is returned.

So either:

1) SpamBlacklist needs to provide a processed message

or:

* SpamBlacklist needs to provide both urls, not just the first (I tested latest master, SpamBlacklist@3390081e4c6). Though this bug should be fixed either way, if we don't get a processed message, needing both is a blocker.
* We'll load these 2 core messages as part of ve.init.mw.ViewPageTarget
* We'll need an equivalent of Language::listToText in core mediawiki.language.js (though I suppose join(', ')  could do meanwhile).
Comment 5 Gerrit Notification Bot 2013-07-16 14:07:30 UTC
Change 73964 had a related patch set uploaded by Krinkle:
mw.ViewPageTarget: Add support for spam blacklist

https://gerrit.wikimedia.org/r/73964
Comment 6 Krinkle 2013-07-16 21:42:31 UTC
Though I knew that the SpamBlacklist has logic in place for returning multiple urls (bug 30332, Ia951d5795c5cedb) it didn't seem to work.

Apparently it does work now. I can't consistently reproduce it only giving one. I'll presume it was an error on my part or an edge case in the regex SpamBlacklist is using and complex wikitext as input.

I've amended the patch set to display multiple urls separated by comma if there is more than one.
Comment 7 Gerrit Notification Bot 2013-07-16 22:52:08 UTC
Change 73964 merged by jenkins-bot:
mw.ViewPageTarget: Add support for spam blacklist

https://gerrit.wikimedia.org/r/73964
Comment 8 James Forrester 2013-07-16 23:07:14 UTC
Fixed and will be going out in a few minutes.

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


Navigation
Links