# HG changeset patch # User Franz Glasner # Date 1692088718 -7200 # Node ID 59a3fb7fcac3f98eafaa9bf2a94f4169a323e8c0 # Parent 0485a033c95d725fa9215c68586a59c9dfa467dd Prohibit "," and "|" in filter names diff -r 0485a033c95d -r 59a3fb7fcac3 configmix/variables.py --- a/configmix/variables.py Tue Aug 15 09:34:49 2023 +0200 +++ b/configmix/variables.py Tue Aug 15 10:38:38 2023 +0200 @@ -132,9 +132,15 @@ def add_filter(name, fn): """Register a variable filter function with name `name` and - implementation `fn` + implementation `fn`. + + `name` may *not* contain ``,`` and ``|`` characters. + + :raises ValueError: If an invalid `name` is given """ + if ('|' in name) or (',' in name): + raise ValueError("invalid filter name: %s" % (name, )) _filter_registry[_normalized(name)] = fn