mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed escaping regression in urlize filter.
Now that the URL is always unescaped as of refs #22267, we should re-escape it before inserting it into the anchor.
This commit is contained in:
@@ -337,7 +337,7 @@ def urlize(text, trim_url_limit=None, nofollow=False, autoescape=False):
|
||||
if autoescape and not safe_input:
|
||||
lead, trail = escape(lead), escape(trail)
|
||||
trimmed = escape(trimmed)
|
||||
middle = '<a href="%s"%s>%s</a>' % (url, nofollow_attr, trimmed)
|
||||
middle = '<a href="%s"%s>%s</a>' % (escape(url), nofollow_attr, trimmed)
|
||||
words[i] = mark_safe('%s%s%s' % (lead, middle, trail))
|
||||
else:
|
||||
if safe_input:
|
||||
|
||||
Reference in New Issue
Block a user