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
Ironholds | |
Jul 5 2013, 7:49 PM |
F11276: mPNNB.jpg | |
Nov 22 2014, 1:49 AM |
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
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.
Attached:
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 examiner.com URL at [[Chad Griffin]] with an incognito window/logged out.
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: 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:
or:
Change 73964 had a related patch set uploaded by Krinkle:
mw.ViewPageTarget: Add support for spam blacklist
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.
Change 73964 merged by jenkins-bot:
mw.ViewPageTarget: Add support for spam blacklist