Topic on Extension talk:AbuseFilter

My AbuseFilter not working properly.

20
Summary by Farvardyn

Thanks a lot to all!

Farvardyn (talkcontribs)

I exported Special:AbuseFilter/5 (User self-renaming or moving user talk pages into article talk space) and Special:AbuseFilter/12 (Replacing a page with obscenities) then imported to my wiki. It seems everything is installed properly and I did set them as Disallow/Enabled/Hidden. Then with another non-admin ordinary account, I tried to add <nowiki>#REDIRECT [[Talk:Test]]</nowiki> in my non-admin talk page, and it did not catch it. The same with second functionality above: I added a bad word (the word starting with f), and it did not hit it niether. The filter was set as 'Disallow', so why why hitting/disallowing was not working fine?

Daimona Eaytoy (talkcontribs)

For filter 5, adding #REDIRECT [[Talk:Test]] to a page is not supposed to cause a match, because this text doesn't match the regular expression used by the filter. Likewise, filter 12 has nothing to do with bad words at all. Are you sure that the links above are correct?

Farvardyn (talkcontribs)
Dinoguy1000 (talkcontribs)

In your first comment, you linked to filters on both MediaWiki.org (this site) and English Wikipedia. Daimona probably just missed this. Wikipedia's filter 5 only triggers on page moves, so simply editing your user talk page and replacing the contents with a redirect won't trigger it. Filter 12 only triggers if the edit includes a reduction in the page size (i.e. replacing most or all of the page's content) along with the profanity, so simply adding a swear also won't trigger it.

Farvardyn (talkcontribs)

@Daimona Eaytoy @Dinoguy1000 I also installed both `New user blanking articles` and `Large deletion from article by new editors` with Warn,Disallow and default error message for both: `abusefilter-warning` and `abusefilter-disallowed`. Then as normal user I tried to large edit and blanking an article, and I got this message:

`[Xrqt36tVvzaBrdFz40ulNwAAA4I] 2020-05-12 14:08:32: Fatal exception of type "Error"`

I tried also by disabling the extension completely and I could large delete/blanking an article and I could do, so I assume one of these filters is triggered and is working fine to disallow/warn it. But why I don't see any static hit (still 0) with irrelevant error message as I did not customize error messages.

Dinoguy1000 (talkcontribs)

A fatal exception means that somewhere the code errored out. Since it didn't log any action, it probably happened before the extension would have logged it. But I can't help with this problem further than that; you'll need someone who's familiar with the code side of the extension probably.

Daimona Eaytoy (talkcontribs)

So you meant filter 5 and 12 on enwiki IIUC. The links above point to filters 5 and 12 on mediawikiwiki, aka the wiki we're on currently. Assuming that I got it right this time, here are the answers.

  • Filter 5: It catches page moves, not redirections. So, in order to trigger it, you'd have to move your own user page to another title in the User: namespace.
  • Filter 12: The filter has too many conditions for me to be able to guess what went wrong. You have to ensure that the account you're using has no more than 30 edits, that the size of the page before and after the edit matches the numbers there, and that the new content of the page matches the regexp used by the filter.
Daimona Eaytoy (talkcontribs)

Whoops, I see Dinoguy1000 replied while I was writing, and the answers are indeed correct.

As for the error: the first thing that comes to mind is, ensure you have installed composer dependencies, especially wikimedia/equivset, as that's needed for using ccnorm. Aside from that, I'd need to see the complete stack trace of the error to understand what's going on (see Manual:How to debug).

Farvardyn (talkcontribs)

@Daimona Eaytoy@Dinoguy1000 Thanks for trying to help. I did read the how to debug link. As about below in index.php:


    error_reporting( -1 );


    ini_set( 'display_startup_errors', 1 );


    ini_set( 'display_errors', 1 );


I got no error. As about:


$wgDebugDumpSql = true;


$wgShowSQLErrors = true;


$wgShowDBErrorBacktrace = true;


$wgDebugLogFile = "debug-{$wgDBname}.log";


I got this trace error: [EDITED by Farvardyn] so I did run composer under AbuseFilter/ folder then `utfnormal` and `equivset` got installed. I also make sure my test account has no more than 30 contribs. But this time, with my test account I can largely delete an article and blank it with no error. This time I get no error nor blanking/largely deletion is trigerred! What else should I do? I highly appreciate your help.

Daimona Eaytoy (talkcontribs)

Glad to see that the first issue is now resolved! As above, unfortunately, there's not much we can do. I can just copy below the conditions checked by the filter, and you could make sure that all of these are satisfied:

  • No more than 30 contribs
  • Page size before the edit greater than 300 bytes, and lower than 300 bytes after the edit, OR more than 5000 bytes removed with the edit
  • The page is not a redirect
  • The page title doesn't contain any of "Sockpuppet investigations", "Sandbox", or the username of the test account
  • The new text of the page contains one of the bad words
  • The old text of the page doesn't contain one of those bad words
Farvardyn (talkcontribs)

@Daimona Eaytoy May I invite you to see that on my wiki? The page I tried blanking is: [EDITED by Farvardyn] and I will delete this link from here after you got it. Please create an account and try to blank it. Let me know which permissions do you need that I grant them to your account in order to test it. After that I can delete your account if you wish to not stay in my wiki. I highly appreciate your help.


Daimona Eaytoy (talkcontribs)

Thank you for sharing the link! AFAICS, you did indeed blank the page, but did not add any bad word. Both conditions should hold. Your blankings are perfect, just make sure to add a bad word as well the next time you try blanking the page :-)

Farvardyn (talkcontribs)
Farvardyn (talkcontribs)

I googled how to translate abusefilter-warning and abusefilter-disallow messages, that it always shows the translated version rather than English and found nothing in google. Please advise. @Daimona Eaytoy @Dinoguy1000

Daimona Eaytoy (talkcontribs)

Since they're custom system messages (see this page for help, I don't know if there's a more appropriate one), I'm not sure if there's a built-in way to translate them. I have little knowledge of the matter.

Dinoguy1000 (talkcontribs)

The translation method for built-in messages (i.e. subpages of the message with the subpage name being the ISO 639 language code for the language being translated to, e.g. for a French translation of a built-in message MediaWiki:Foobar, you would go to MediaWiki:Foobar/fr) might also work for custom messages, though I've never tried it myself.

Farvardyn (talkcontribs)

How can I set a custom translation for built-in message like abusefilter-disallow? I avoid automatic translation like google translator, I want to set a custom translation. How can I do so? @Daimona Eaytoy @Dinoguy1000

Dinoguy1000 (talkcontribs)

Do you mean abusefilter-disallowed? abusefilter-disallow isn't a built-in message. In any case, for built-in messages, you would determine the language tag for the language you want to translate to (Wikipedia has lists of these, linked from the ISO 639 page), and add that as a subpage name for the message you want to translate (e.g. for a French version of abusefilter-disallowed, it would be abusefilter-disallowed/fr). Note that built-in messages of MediaWiki itself, and any extensions used by WMF wikis (such as AbuseFilter), are already likely to be translated into most popular languages, so any built-in messages you're interested in translating may already have been translated into the language(s) you're interested in. This should be self-evident when you view the appropriate subpages, since you'll see translated content there instead of the generic "page doesn't exist" message.

Farvardyn (talkcontribs)

Got it. Thanks. Just one more question: CommentStreams added `staff` user group. Any other user groups are already translated except this one.How can I translated a user group? @Dinoguy1000 @Daimona Eaytoy

Farvardyn (talkcontribs)

The main reason I want to customize Mediawiki:abusefilter-disallowed is that I want to use Fmbox template to add an icon beside the text. But if I use any of Mbox templates, it looks like https://i.stack.imgur.com/1swED.png because Mediawiki:abusefilter-disallowed already uses a red box by default itself too. How to fix it? @Daimona Eaytoy@Dinoguy1000

Reply to "My AbuseFilter not working properly."