#32702: urlize() should not decode URL fragments
---------------------------------------+------------------------
Reporter: Victor Shih | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+------------------------
Currently `urlize()` will unquote then quote the fragment component of
URLs. This transformation can be problematic - for example if it contains
a %-encoded URL:
example.com/home#next=https%3A%2F%2Fexample2.com
This results in:
<a
href="https://example.com/home#next=https://example2.com">https://example.com/home#next=https%3A%2F%2Fexample2.com</a>
Note how the generated href has its fragment decoded.
Because the formatting for the fragment is completely arbitrary and site-
dependent, I suggest that the fragment should not be altered at all and
simply rendered as-is.
Patch: https://github.com/django/django/pull/14275
Related ticket: https://code.djangoproject.com/ticket/9655
Previous related PRs:
https://github.com/django/django/pull/2902
https://github.com/django/django/pull/4253
https://github.com/django/django/pull/4292
--
Ticket URL: <https://code.djangoproject.com/ticket/32702>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.9f079b78f7bbdcf0e2911d49c7a19263%40djangoproject.com.