Opened 4 years ago

Closed 4 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:

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 Changed 4 years ago by d0ugal

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplication of #9655

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