Opened 13 years ago

Closed 13 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: no

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 13 years ago.
urlize_test.diff (2.0 KB ) - added by beneliott 13 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Jonas H., 13 years ago

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

comment:2 by Julien Phalip, 13 years ago

Type: UncategorizedBug

by beneliott, 13 years ago

Attachment: urlize_test.diff added

comment:3 by beneliott, 13 years ago

Needs tests: unset

comment:4 by beneliott, 13 years ago

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

comment:5 by Julien Phalip, 13 years ago

Resolution: duplicate
Status: newclosed

This is actually a duplicate of #9655.

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