Opened 4 years ago

Closed 4 years ago

#16020 closed Bug (duplicate)

urlize() incorrectly escapes query string escapes

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

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by jonash

  • Easy pickings set
  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by julien

  • Type changed from Uncategorized to Bug

Changed 4 years ago by beneliott

comment:3 Changed 4 years ago by beneliott

  • Needs tests unset

comment:4 Changed 4 years ago by beneliott

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

comment:5 Changed 4 years ago by julien

  • Resolution set to duplicate
  • Status changed from new to closed

This is actually a duplicate of #9655.

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