Opened 6 years ago

Closed 6 years ago

#16020 closed Bug (duplicate)

urlize() incorrectly escapes query string escapes

Reported by: Chris Lamb Owned by: nobody
Component: Template system Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX:

Description

>>> from django.utils.html import urlize

>>> urlize('http://site.com/?foo%20bar')
u'<a href="http://site.com/?foo%2520bar">http://site.com/?foo%20bar</a>'
#                              ^^^^^

>>> urlize('www.site.com/?foo%20bar')
u'<a href="http://www.site.com/?foo%2520bar">www.site.com/?foo%20bar</a>'
#                                  ^^^^^

Patch attached.

Attachments (2)

08-urlize-encoded-spaces-correctly-16020.diff (1.1 KB) - added by Chris Lamb 6 years ago.
urlize_test.diff (2.0 KB) - added by beneliott 6 years ago.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Chris Lamb

comment:1 Changed 6 years ago by Jonas H.

Easy pickings: set
Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Julien Phalip

Type: UncategorizedBug

Changed 6 years ago by beneliott

Attachment: urlize_test.diff added

comment:3 Changed 6 years ago by beneliott

Needs tests: unset

comment:4 Changed 6 years ago by beneliott

Discussion of this issue on bugs.python.org:
http://bugs.python.org/issue2637

comment:5 Changed 6 years ago by Julien Phalip

Resolution: duplicate
Status: newclosed

This is actually a duplicate of #9655.

Note: See TracTickets for help on using tickets.
Back to Top