Opened 13 years ago

Closed 13 years ago

#16070 closed Bug (duplicate)

Urlize improperly quotes %

Reported by: mitch@… Owned by: nobody
Component: Template system Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If urlize is given a URL with a percent sign in it, it will quote it:

from django.utils.html import urlize
urlize('http://www.example.com/test%20case')

u'<a href="http://www.example.com/test%2520case">http://www.example.com/test%20case</a>'

Which breaks links that are already percent sign quoted. Should % be passed in to urlquote as a safe character to prevent this? Or should it be an option? I am using urlize on user generated input, and links they insert with %'s in them are broken.

Change History (1)

comment:1 by Dougal Matthews, 13 years ago

Resolution: duplicate
Status: newclosed

Duplication of #9655

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