Page MenuHomePhabricator

Update WikiEditor for changes in AbuseFilter and SpamBlacklist API error responses
Open, Needs TriagePublic

Description

API error responses generated by AbuseFilter and SpamBlacklist have changed, as announced here: https://lists.wikimedia.org/pipermail/mediawiki-api-announce/2019-September/000148.html (relevant task: T229539).

It appears you have special handling for the old responses. It only affects event logging.

extensions/WikiEditor/includes/WikiEditorHooks.php:
  300: 				} elseif ( isset( $errors[0][0] ) && $errors[0][0] === 'abusefilter-disallowed' ) {

Event Timeline

So it turns out that this line doesn't need updating, because it is looking at the error message key rather than the error code, and still works as expected.

However, a few lines below is this:

				} elseif ( isset( $errors[0][0] ) && $errors[0][0] === 'spamprotectiontext' ) {

…and this actually does need updating – not because of the API changes, but because of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/SpamBlacklist/+/531302.

Change 536375 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/WikiEditor@master] Update SpamBlacklist error logging

https://gerrit.wikimedia.org/r/536375

Change 536375 merged by jenkins-bot:
[mediawiki/extensions/WikiEditor@master] Update SpamBlacklist error logging

https://gerrit.wikimedia.org/r/536375