diff options
| author | Mike Edmunds <medmunds@gmail.com> | 2024-12-14 15:57:41 -0800 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-12-17 10:18:48 +0100 |
| commit | 322e49ba3071022dde96f6aae71a578a1588db33 (patch) | |
| tree | 58cfd34dd45388a7b4e91b4dc98631c309ab29a2 /django/utils | |
| parent | b44efdfe543c9b9f12690b59777e6b275cb08103 (diff) | |
Fixed #36012 -- Made mailto punctuation percent-encoded in Urlizer.
Urlizer was not properly encoding email addresses containing punctuation
in generated mailto links. Per RFC 6068, fixed by percent encoding
(urllib.parse.quote) the local and domain address parts.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/html.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/utils/html.py b/django/utils/html.py index bc336d88a6..0d107a0da9 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -357,6 +357,8 @@ class Urlizer: domain = punycode(domain) except UnicodeError: return word + local = quote(local, safe="") + domain = quote(domain, safe="") url = self.mailto_template.format(local=local, domain=domain) nofollow_attr = "" # Make link. |
