Topic on Extension talk:AbuseFilter

Summary by MarioSuperstar77

Could figure out the issue.

MarioSuperstar77 (talkcontribs)

I made a rule specifically to prevent new users from making unconstructive edits, but it flags when any new account is created with an email address specifically.

(user_editcount <3 &

((edit_delta < -1000)&(
 added_links))
) | (user_editcount <1 &(
 edit_delta < -3000)
)

How would you write the rule for it to work as intended?

Daimona Eaytoy (talkcontribs)

It depends on the definition of "new users" and "unconstructive edits", this way is a bit too vague. The code above seems sensible to me. If you want to exlude users with a verified email address, you should check that user_emailconfirm === null.

MarioSuperstar77 (talkcontribs)

I edited my post, I think I misspoke what I meant was my issue.

Daimona Eaytoy (talkcontribs)

Ah, I understand now. For account creations, you have edit_delta === null, and as in PHP, null is smaller than any number, so edit_delta < -3000 is true. So you have to check that action === 'edit'.

MarioSuperstar77 (talkcontribs)

When someone tries to make an account with an email it still trips the abuse filter.

action === 'edit' & (user_editcount <3 &

((edit_delta < -1000)&(

  added_links))

) | (user_editcount <1 &(

  edit_delta < -3000)

) | (user_editcount <1 &(

  added_links))

Daimona Eaytoy (talkcontribs)

There are missing parentheses. Right now what you have is equivalent to action === 'edit' & cond1 | cond2 | cond3. In the AbuseFilter language, like in many other programming languages (e.g. PHP, JavaScript, C), logical AND has higher precedence than OR, so that code is equivalent to (action === 'edit' & cond1 ) | cond2 | cond3, which means the action check is only applied to cond1. Instead, what you want is action === 'edit' & ( <conds here> ). I should also note that this filter will catch edits by registered users, unsure if this is what you want. If not, you also need to check that action === 'edit' & user_groups contains "user" & ( <the rest> ).

MarioSuperstar77 (talkcontribs)

The name of the rule is "New user removes text and adds links", so it is to prevent spam on my wiki. Thanks for the help!