Summary for people coming here from Tech News
Recently, there have been some changes to the AbuseFilter parser (T214674). This changed the way variables are handled. The most important changes are:
- Only variables for the current action are available. Which means, during an edit you cannot use e.g. moved_from_namespace or accountname, during an account creation you cannot check added_lines, and so on. I recommend to check the action variable when using action-specific variables; in the future, we'll introduce a new function to check whether a variable is set.
- Custom variables defined inside a branch may not be available outside of the branch. For instance, if you have: page_namespace == 0 & (my_var := 'foo'); added_lines contains my_var, the variable my_var is used outside of the branch (= pair of parentheses) where it's declared. Trying to do so could produce unexpected results in certain cases. [More precisely: the assignment will be skipped in short-circuit evaluation, which in this case happens when page_namespace is non-zero.] Note: This is only known to affect arwiki's filter 130 and wikidata filter 34.
This could affect existing abuse filters, making them not match some actions. If you see that a filter has not been matching anything for a long time, while it used to match constantly, please check that it's not affected by this bug. In the vast majority of the cases, checking point 1. above is enough.
In the future, we may be able to provide a list of affected filters. If you're interested in such a list, please to this task.