VisualEditor: Add support for spam blacklist errors in save dialog
Closed, ResolvedPublic


If a user hits the spam blacklist they VE responds merely by informing them "Error: Invalid error code". This is...not helpful.

Version: unspecified
Severity: major

bzimport set Reference to bz50826.
Ironholds created this task.Via LegacyJul 5 2013, 7:49 PM
Jdforrester-WMF added a comment.Via ConduitJul 10 2013, 10:25 PM
  • Bug 51139 has been marked as a duplicate of this bug. ***
Catrope added a comment.Via ConduitJul 10 2013, 10:32 PM

Created attachment 12821
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.


bzimport added a comment.Via ConduitJul 16 2013, 5:29 AM

joedecker wrote:

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 URL at [[Chad Griffin]] with an incognito window/logged out.

Krinkle added a comment.Via ConduitJul 16 2013, 1:58 PM

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]])

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: and

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": "",
    "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


  • 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
  • We'll need an equivalent of Language::listToText in core mediawiki.language.js (though I suppose join(', ') could do meanwhile).
gerritbot added a comment.Via ConduitJul 16 2013, 2:07 PM

Change 73964 had a related patch set uploaded by Krinkle:
mw.ViewPageTarget: Add support for spam blacklist

Krinkle added a comment.Via ConduitJul 16 2013, 9:42 PM

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.

gerritbot added a comment.Via ConduitJul 16 2013, 10:52 PM

Change 73964 merged by jenkins-bot:
mw.ViewPageTarget: Add support for spam blacklist

Jdforrester-WMF added a comment.Via ConduitJul 16 2013, 11:07 PM

Fixed and will be going out in a few minutes.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.