realm_filters: Allows more use of & and friends in URLs.

We had some excessively tight rules about what characters were
allowed, which in particular prevented using `?foo=bar&baz=quux`
structures in the realm filters URLs.

Fixes #12239.
This commit is contained in:
Tim Abbott
2019-05-13 13:28:17 -07:00
parent 2bb3af1ade
commit a4bf15bbc7
2 changed files with 5 additions and 5 deletions

View File

@@ -594,7 +594,7 @@ def filter_pattern_validator(value: str) -> None:
raise ValidationError(error_msg)
def filter_format_validator(value: str) -> None:
regex = re.compile(r'^([\.\/:a-zA-Z0-9#_?=-]+%\(([a-zA-Z0-9_-]+)\)s)+[a-zA-Z0-9_-]*$')
regex = re.compile(r'^([\.\/:a-zA-Z0-9#_?=&-]+%\(([a-zA-Z0-9_-]+)\)s)+[/a-zA-Z0-9#_?=&-]*$')
if not regex.match(value):
raise ValidationError(_('Invalid URL format string.'))