Extension talk:AbuseFilter

Jump to navigation Jump to search

About this board

19 previous topics. Previous discussion was archived at Extension talk:AbuseFilter/Archive 1 on 2016-10-24.

Jer Hughes (talkcontribs)

I see the script creates a user called "Abuse filter". Is this accounted needed? And if it is needed, can I rename it to something else?

Daimona Eaytoy (talkcontribs)

@Jer Hughes: Yes, it is needed to perform some actions like block, degroup and blockautopromote, if they are enabled (ref). It may also occasionally perform maintenance tasks, if we change something in the filter syntax. As for renaming, yes, you can. The name of the user is the message abusefilter-blocker. Note that, if you change the message, any previous log for the old name won't be moved. Moreover, we're planning on making it use the same name everywhere (T160666), and at that point, it would only be renamable if you change the source code.

Jer Hughes (talkcontribs)

Thank you very much. If I rename the user, how would I know in the future and what point its no longer working and I'd have to change the name in the source code?

Daimona Eaytoy (talkcontribs)

The user will be automatically renamed to the new name ("Abuse filter") during update.php, and changing the message above won't work. Although I have to say, this shouldn't happen anytime soon.

Reply to "User:Abuse filter"

New "Abuse filter" administrators on "all" WM wikis

Dcljr (talkcontribs)

Does anyone here know why (apparently) all Wikimedia content wikis just got a new adminstrator called "Abuse filter" (in the local language)? This happened on December 17th at around 3–6am UTC. Shouldn't this have happened long ago when the AbuseFilter extension was first installed/enabled on Wikimedia wikis?

Ejs-80 (talkcontribs)
MusikAnimal (talkcontribs)

Special:CentralAuth/Abuse_filter shows only a handful of wikis (presumably the ones that have AbuseFilter-imposed blocks enabled), and the accounts were attached between July 2014 and April 2015. You say there are other accounts with localized names?

Dcljr (talkcontribs)

Just look at 'Special:ListAdmins' on "any" Wikimedia wiki (examples: w:csb: s:eo: voy:uk:). You'll probably see a redlinked username that corresponds to "Abuse filter" in the local language of that wiki, that was created on 17 December 2018. The list at 'Special:CentralAuth/Abuse_filter' presumably (per Daimona Eaytoy below) contains the only WM wikis that didn't get a new admin created on that date.

Thanks to everyone for the info.

Daimona Eaytoy (talkcontribs)

The task above has all the info, which I'll sum up below. Yes, the AbuseFilter extension owns a system user with localized name (msg is "abusefilter-blocker"), used mainly to block users (and a couple of minor other things). In the linked patch we launched a script to clean up some filters across wikis which have wrong syntax, and we decided to use such user to perform the task. While the script hasn't made any changes for now, the account has been automatically created where it didn't exist. On wikis with block enabled, the user exists since the day block was enabled, which could be back to 2008 when the extension was created. In short, don't worry about it; we'll write a couple of lines in tech news before the final run.

Ejs-80 (talkcontribs)
Reply to "New "Abuse filter" administrators on "all" WM wikis"

How does Abuse Filter block this text?

3 (talkcontribs)
[[Cate<noinclude></noinclude>gory:Something unwanted]]

In Abuse Filter parameters, only new_text, new_html variables can be used, there is no variable of Template-Expanded text.

MusikAnimal (talkcontribs)

Try using added_lines_pst or new_pst. These represent pre-save transformed wikitext and should contain things like substitution syntax, and I presume the noinclude tags. I will warn you that the pst variables tend to be rather slow. If you're only looking within category syntax, you might first check added_lines contains "[[Category as this is cheap, then run the more expensive check against pst. (talkcontribs)

Thanks, but how to deal this:

[[Cate{{{|gory}}}:Something unwanted]]
[[Cate{{{anyname|gory}}}:Someth{{{anyname|ing unw}}}anted]]
Reply to "How does Abuse Filter block this text?"

Is there a way to detect the use of spaces to get around filters?

Diamond Blizzard (talkcontribs)

I'm asking because I just saw someone adding stuff such as what can be seen in this diff: https://en.wikipedia.org/w/index.php?title=Del_City_High_School&diff=prev&oldid=854268628 Presumably, it was the spaces that prevented the change from being detected, as things such as this: https://en.wikipedia.org/wiki/Special:AbuseLog/21759611 were detected and blocked immediately. I do not feel confident at all in my ability to successfully make any changes myself to filters, so I'm asking this question.

MusikAnimal (talkcontribs)

You can use rmwhitespace() but we'd need to be careful with that filter to make sure no false positives happen as a result. E.g. "ass" matching "as soon" -- though this specific example shouldn't happen.

Reply to "Is there a way to detect the use of spaces to get around filters?"
Summary by PlavorSeol

Problem fixed

PlavorSeol (talkcontribs)

When I go to Special:AbuseFilter after installing AbuseFilter and run update.php, it shows following database error:

[bfb1bf7c329d630ebc5d6e00] 2018-06-25 15:18:44: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"

Matěj Suchánek (talkcontribs)
PlavorSeol (talkcontribs)

Database error on Special:AbuseFilter:

[7584d3a6d8cb66b963a8b9a0] /plavormindtest/index.php?title=Special:AbuseFilter Wikimedia\Rdbms\DBQueryError from line 1443 of C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT af_id,af_enabled,af_deleted,af_pattern,af_global,af_public_comments,af_hidden,af_hit_count,af_timestamp,af_user_text,af_user,af_actions,af_group,af_throttled FROM abuse_filter WHERE af_deleted = '0' ORDER BY af_id LIMIT 51

Function: IndexPager::buildQueryInfo (AbuseFilterPager)

Error: 1 no such table: abuse_filter


  1. 0 C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php(1413): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
  1. 1 C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php(1186): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  1. 2 C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php(1640): Wikimedia\Rdbms\Database->query(string, string)
  1. 3 C:\NGINX\html\plavormindtest\includes\pager\IndexPager.php(368): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
  1. 4 C:\NGINX\html\plavormindtest\includes\pager\IndexPager.php(224): IndexPager->reallyDoQuery(string, integer, boolean)
  1. 5 C:\NGINX\html\plavormindtest\includes\pager\IndexPager.php(608): IndexPager->doQuery()
  1. 6 C:\NGINX\html\plavormindtest\includes\pager\TablePager.php(292): IndexPager->isNavigationBarShown()
  1. 7 C:\NGINX\html\plavormindtest\extensions\AbuseFilter\includes\Views\AbuseFilterViewList.php(284): TablePager->getNavigationBar()
  1. 8 C:\NGINX\html\plavormindtest\extensions\AbuseFilter\includes\Views\AbuseFilterViewList.php(134): AbuseFilterViewList->showList(array, array)
  1. 9 C:\NGINX\html\plavormindtest\extensions\AbuseFilter\includes\special\SpecialAbuseFilter.php(122): AbuseFilterViewList->show()
  1. 10 C:\NGINX\html\plavormindtest\includes\specialpage\SpecialPage.php(565): SpecialAbuseFilter->execute(NULL)
  1. 11 C:\NGINX\html\plavormindtest\includes\specialpage\SpecialPageFactory.php(569): SpecialPage->run(NULL)
  1. 12 C:\NGINX\html\plavormindtest\includes\MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
  1. 13 C:\NGINX\html\plavormindtest\includes\MediaWiki.php(867): MediaWiki->performRequest()
  1. 14 C:\NGINX\html\plavormindtest\includes\MediaWiki.php(524): MediaWiki->main()
  1. 15 C:\NGINX\html\plavormindtest\index.php(42): MediaWiki->run()
  1. 16 {main}
PlavorSeol (talkcontribs)

Also update.php shows following error:

Creating abuse_filter table ...[b894800c426189ba94cbe1ab] [no req] Wikimedia\Rdbms\DBQueryError from line 1443 of C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: CREATE TABLE abuse_filter (

af_pattern BLOB NOT NULL,
af_user_text BLOB NOT NULL,
af_timestamp BLOB NOT NULL,
af_enabled INTEGER not null default 1,
af_comments BLOB,
af_public_comments BLOB,
af_hidden INTEGER not null default 0,
af_hit_count INTEGER not null default 0,
af_throttled INTEGER NOT NULL default 0,
af_group BLOB  NOT NULL DEFAULT 'default'

Function: Wikimedia\Rdbms\Database::sourceFile( C:\NGINX\html\plavormindtest\extensions\AbuseFilter/abusefilter.tables.sqlite.sql ) Error: 1 near "af_group": syntax error


  1. 0 C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php(1413): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
  2. 1 C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php(1186): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  3. 2 C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php(4260): Wikimedia\Rdbms\Database->query(string, string)
  4. 3 C:\NGINX\html\plavormindtest\includes\libs\rdbms\database\Database.php(4195): Wikimedia\Rdbms\Database->sourceStream(resource (closed), NULL, NULL, string, NULL)
  5. 4 C:\NGINX\html\plavormindtest\includes\installer\DatabaseUpdater.php(683): Wikimedia\Rdbms\Database->sourceFile(string)
  6. 5 C:\NGINX\html\plavormindtest\includes\installer\DatabaseUpdater.php(726): DatabaseUpdater->applyPatch(string, boolean, string)
  7. 6 C:\NGINX\html\plavormindtest\includes\installer\DatabaseUpdater.php(482): DatabaseUpdater->addTable(string, string, boolean)
  8. 7 C:\NGINX\html\plavormindtest\includes\installer\DatabaseUpdater.php(450): DatabaseUpdater->runUpdates(array, boolean)
  9. 8 C:\NGINX\html\plavormindtest\maintenance\update.php(200): DatabaseUpdater->doUpdates(array)
  10. 9 C:\NGINX\html\plavormindtest\maintenance\doMaintenance.php(94): UpdateMediaWiki->execute()
  11. 10 C:\NGINX\html\plavormindtest\maintenance\update.php(245): require_once(string)
  12. 11 {main}
Matěj Suchánek (talkcontribs)

Try downloading the newest version now. It seems Daimona Eaytoy fixed some syntax errors related to sqlite after your report.

Daimona Eaytoy (talkcontribs)

Yeah, I noticed it independently. BTW, @PlavorSeol, I suggest you to report these bugs on phabricator, so that they won't probably get unnoticed.

PlavorSeol (talkcontribs)

@Daimona Eaytoy Thanks, it works now. At first, I thought I configured my wiki incorrectly so that it had a problem.

Los Vegas (talkcontribs)

What i set block duration?

Matěj Suchánek (talkcontribs)

$wgAbuseFilterBlockDuration for all filters. Setting for individual filters is not possible.

Question regarding the abuse filter

Awesome Aasim (talkcontribs)

What is the difference between "block" and "block autopromote"?

Insure the stability of the filter decisions?

Rical (talkcontribs)

The limit of actions number is $wgAbuseFilterProfileActionsCap = 10 000. Is there a way to insure the stability of the filter decisions? Example: a ponderation of 0.0001 for each new case.


Nirmos (talkcontribs)

Could "Enable notifications for private filters" be elaborated on? Is the reader to assume that "notifications" means Echo here? If that's the case, it might make sense to link to Notifications, for example.

Matěj Suchánek (talkcontribs)

Refers to "notifications" in $wgAbuseFilterNotifications in the row above.

Nirmos (talkcontribs)

Ah, I completely missed that. I feel stupid now. Still, that description is not super clear to mortal people like me. If I understand the description correctly, $wgAbuseFilterNotifications is whether to show log events for hits (like EventStreams does), but neither "log" or "event" is mentioned. But I rest my case :D Thanks!

Seewolf (talkcontribs)

I have created a filter to slow down high frequency troll account creation via proxy: [[:de:Spezial:Missbrauchsfilter/250|]]. action = createaccount, 1 action per 60 seconds. My problem is that a failed try because of a misspelled captcha also counts as one action, so a newbie who gets the captcha wrong has no chance to create an account.

Is this intended or could it be solved?

Alex Mashin (talkcontribs)
Reply to "createaccount and captcha"