Page MenuHomePhabricator

Some parser errors are not reported by the syntax check
Closed, ResolvedPublic

Description

Going to Special:AbuseFilter/tools and running a "check syntax" on the following snippet:

accountname rlike "("

results in no error, but the regexp is obviously wrong. I suspect this happens because the regex is validated when the LHS is not DUNDEFINED, and accountname in this case is.


Update: This happens for invalid regexps (in (i)rlike and rcount), and invalid IP ranges passed to ip_in_range

Event Timeline

Daimona triaged this task as High priority.

Change 540165 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Better handling of keywords and functions

https://gerrit.wikimedia.org/r/540165

Daimona renamed this task from Regex error not reported by the syntax check to Some parser errors are not reported by the syntax check.Oct 1 2019, 4:36 PM
Daimona updated the task description. (Show Details)

To confirm - did these ever work in recent history? Presumably these fail unconditionally in a way that filter is effectively disabled / never matches. Is that correct?

They stopped working as of the DUNDEFINED update that happened a while ago. Those filters error out and never match, yes.

Change 549567 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Make to sure to report division by zero when the LHS is undefined

https://gerrit.wikimedia.org/r/549567

Change 540165 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Better handling of keywords and functions

https://gerrit.wikimedia.org/r/540165

Change 549567 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Make to sure to report division by zero when the LHS is undefined

https://gerrit.wikimedia.org/r/549567