mirror of https://github.com/zulip/zulip.git
linkifiers: Allow semicolons in target URLs.
This fixes another user report. The right fix is to convert this to use a normal URL validator after substitution.
This commit is contained in:
parent
a06f35182d
commit
dc2aa031f6
|
@ -656,7 +656,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.'))
|
||||
|
|
|
@ -82,7 +82,7 @@ class RealmFilterTest(ZulipTestCase):
|
|||
self.assertIsNotNone(re.match(data['pattern'], 'lp:123'))
|
||||
|
||||
data['pattern'] = r'!(?P<id>[0-9]+)'
|
||||
data['url_format_string'] = 'https://realm.com/my_realm_filter/?value=%(id)s'
|
||||
data['url_format_string'] = 'https://realm.com/index.pl?Action=AgentTicketZoom;TicketNumber=%(id)s'
|
||||
result = self.client_post("/json/realm/filters", info=data)
|
||||
self.assert_json_success(result)
|
||||
self.assertIsNotNone(re.match(data['pattern'], '!123'))
|
||||
|
|
Loading…
Reference in New Issue