Page MenuHomePhabricator

Reference of moved_to_title variable on action=edit causes filter to never match
Closed, DuplicatePublic

Description

I have a filter that checks for bad words in contents and also in page titles if someone wants to rename a page.

However, since I upgraded to 1.34 (I was in 1.32 before) it stopped to match anything.

I created a variable to make the relevant text lowercase and concatenate added_lines and also moved_to_title.

(added_lines_lc := str_replace(lcase(added_lines + " " + page_title + " " + moved_to_title + " " + summary + " " + user_name), "0", "o");

I discovered that when moved_to_title is present in this variable construction, no matter what conditions I put on checks of added_lines_lc it never matches. If I remove it, the filter matches again. Why? I suspect the filter crashes somehow because of this variable

Basic test case when examining an edit:

(added_lines_lc := "test" + " " + moved_to_title; 
added_lines_lc rlike "test")

This causes the filter to not match.

However, if I instead change it to a null reference:

(added_lines_lc := "test" + " " + null; 
added_lines_lc rlike "test")

This causes the filter to match (as expected)

This happens on the REL1_34 branch of AbuseFilter