Opened 13 years ago

Closed 13 years ago

#18071 closed Bug (fixed)

urlize is case-sensitive

Reported by: luke@… Owned by: nobody
Component: Uncategorized Version: 1.4
Severity: Normal Keywords: urlize
Cc: adamzap@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

When you run urlize() on url schemes that have been uppercased, urlize fails to convert them to clickable links.

>>> from django.utils.html import urlize
>>> urlize("foo http://bar.com https://baz.com HTTPS://bar.com")
u'foo <a href="http://bar.com">http://bar.com</a> <a href="https://baz.com">https://baz.com</a> HTTPS://bar.com'

Expected output:

>>> from django.utils.html import urlize
>>> urlize("foo http://bar.com https://baz.com HTTPS://bar.com")
u'foo <a href="http://bar.com">http://bar.com</a> <a href="https://baz.com">https://baz.com</a> <a href="https://bar.com">HTTPS://bar.com</a>'

Attachments (2)

urlize.patch (942 bytes ) - added by luke@… 13 years ago.
patch to make url regex case insensitive
18071-regression-test.diff (704 bytes ) - added by Adam Zapletal 13 years ago.
Test for uppercase URL schemes with urlize

Download all attachments as: .zip

Change History (5)

by luke@…, 13 years ago

Attachment: urlize.patch added

patch to make url regex case insensitive

comment:1 by Claude Paroz, 13 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

by Adam Zapletal, 13 years ago

Attachment: 18071-regression-test.diff added

Test for uppercase URL schemes with urlize

comment:2 by Adam Zapletal, 13 years ago

Cc: adamzap@… added
Needs tests: unset

comment:3 by Claude Paroz, 13 years ago

Resolution: fixed
Status: newclosed

In [17898]:

Fixed #18071 -- Ignored case sensitivity in urlize utility. Thanks luke@… and adamzap for the report and the patch.

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