Opened 2 years ago

Closed 2 years ago

#20172 closed Bug (fixed)

utils.html.urlize does not recognize IPv6 URLs

Reported by: glic3rinu Owned by: nobody
Component: Utilities Version: 1.5
Severity: Normal Keywords: urlize, ipv6
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Current urlize regex does not interpret IPv6 URLs because of being between brackets: [%(ipv6_address)s]

>>> from django.utils.html import urlize
>>> urlize("http://[fdf5:5351:1dfd::2]/api/nodes/81")
u'http://[fdf5:5351:1dfd::2]/api/nodes/81'

Change History (2)

comment:1 Changed 2 years ago by glic3rinu

  • Easy pickings set
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Pull request https://github.com/django/django/pull/981 fixes the issue and also adds a testcase for IPv6 URLs

comment:2 Changed 2 years ago by Claude Paroz <claude@…>

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

In b474ffe63a3f99daeef2324a674f7ddfbb653c41:

Fixed #20172 -- Ensured urlize supports IPv4/IPv6 addresses

Thanks Marc Aymerich for the report and the initial patch.

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