Opened 5 years ago

Closed 5 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@… 5 years ago.
patch to make url regex case insensitive
18071-regression-test.diff (704 bytes) - added by Adam Zapletal 5 years ago.
Test for uppercase URL schemes with urlize

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by luke@…

Attachment: urlize.patch added

patch to make url regex case insensitive

comment:1 Changed 5 years ago by Claude Paroz

Needs tests: set
Triage Stage: UnreviewedAccepted

Changed 5 years ago by Adam Zapletal

Attachment: 18071-regression-test.diff added

Test for uppercase URL schemes with urlize

comment:2 Changed 5 years ago by Adam Zapletal

Cc: adamzap@… added
Needs tests: unset

comment:3 Changed 5 years ago by Claude Paroz

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