Go to file
Bartosz Dziewoński 1826d39620 Use custom error code for all edit and upload API responses
The error code 'abusefilter-disallowed' or 'abusefilter-warning' is
used, depending on whether the filter only warns (and will allow the
action when retried) or prevents the user from performing the action.
The API response has been extended with some additional properties.

* For simple filters with no custom messages where the only action is
  'disallow' or 'warn', the error code is the same as before.
* For filters with different actions, different error codes would
  previously be returned; 'abusefilter-disallowed' will be returned
  for them all, with the actions taken listed in the
  .abusefilter.actions property of the API response.
* For filters with custom messages, the message key would previously
  be used as the error code; now 'abusefilter-disallowed' or
  'abusefilter-warning' is used, with the message available in the
  .message property of the API response.

Also cleaned up some dead "forwards-compatibility" code and made a
recently introduced public method private.

The new functionality depends on Ifac8995a4d16d11840cee814177fc2808bc2072c
in MediaWiki core, older MediaWiki versions behave mostly as before.

The new .message property contains both the key and the parameters
duplicated from .abusefilter, so that the client doesn't have to know
what AbuseFilter is - it'll be able to just display the given
message with the given parameters. My specific use case is the upload
dialog in core (core shouldn't have to know about any extensions).

See also TitleBlacklist change I97c1f5c6bbbdfc0b8ea9914bb075d5299c14df8f.

Bug: T137961
Change-Id: I5780eae96930211191ecd874aacf53fdacb58f89
2016-07-11 19:20:19 +00:00
api Remove executable bit from files 2016-04-08 14:00:52 +00:00
db_patches abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
i18n Localisation updates from https://translatewiki.net. 2016-07-10 22:17:48 +02:00
maintenance Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00
modules Compress PNGs with zopflipng 2016-02-21 00:51:11 +00:00
special Merge "Support GENDER in two more log messages" 2016-06-25 15:31:38 +00:00
tests Optimize 'count()' function 2016-04-17 08:32:27 +02:00
Views Merge "Add GENDER to abusefilter-revert-preview-item" 2016-06-25 15:31:41 +00:00
.gitignore Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00
.gitreview Add .gitreview file 2012-03-22 13:55:41 -07:00
.jshintignore Add npm entry point 2016-02-29 19:52:23 +00:00
.jshintrc Add npm entry point 2016-02-29 19:52:23 +00:00
AbuseFilter.alias.php Localisation updates from https://translatewiki.net. 2015-06-14 21:00:08 +02:00
AbuseFilter.class.php Use custom error code for all edit and upload API responses 2016-07-11 19:20:19 +00:00
AbuseFilter.hooks.php Use custom error code for all edit and upload API responses 2016-07-11 19:20:19 +00:00
AbuseFilter.parser.php Optimize 'rcount()' function 2016-04-27 18:01:56 +02:00
AbuseFilter.php Change some globals to work better with extension registration 2016-06-06 19:53:53 +00:00
abusefilter.tables.pg.sql abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
abusefilter.tables.sql abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
abusefilter.tables.sqlite.sql abuse_filter_log table only uses tinyint not int for namespace ID 2014-03-04 02:24:27 +00:00
AbuseFilterPreAuthenticationProvider.php Add $options parameter for testUserForCreation() 2016-06-16 17:33:42 -04:00
AbuseFilterTokenizer.php Remove unnecessary phpcs overrides 2016-04-12 12:36:06 +00:00
AbuseFilterVariableHolder.php Avoid using computed variables to determine stash keys 2016-06-28 21:17:45 +00:00
AbuseLogHitFormatter.php Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00
composer.json Add extension.json, empty php entry point 2016-06-03 19:16:26 +00:00
COPYING Add COPYING 2014-01-22 21:21:10 +00:00
extension.json Provide page text and edit summary when filtering file uploads 2016-07-09 13:31:15 +00:00
Gruntfile.js Add npm entry point 2016-02-29 19:52:23 +00:00
hooks.txt (bug 42064) AbuseFilter + EditFilterMergedContent 2013-01-17 11:18:28 +01:00
package.json Add npm entry point 2016-02-29 19:52:23 +00:00
phpcs.xml Add support for PHP CodeSniffer checks 2016-01-06 09:59:47 -08:00