Opened 9 years ago

Closed 7 years ago

#12183 closed Bug (fixed)

urlize doesn't always add rel=nofollow

Reported by: eronen Owned by: nobody
Component: Template system Version: 1.1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


If the text passed to "urlize" template filter or django.utils.html.urlize contains multiple URLs,
and one of them is a mailto: URL, then the URLs after the mailto URL will not have rel=nofollow even
when you called urlize with nofollow=True.

Fix: Move the line "nofollow_attr = nofollow and ' rel="nofollow"' or " inside the
for loop (one line downwards)

Change History (6)

comment:1 Changed 9 years ago by Russell Keith-Magee

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 9 years ago by Tom Mortimer-Jones

Needs tests: unset

I have attached joint test and fix patches for this bug to ticket #119911. I won't upload them again here.

comment:3 Changed 9 years ago by Tom Mortimer-Jones

Sorry that should have been ticket #11911.

comment:4 Changed 8 years ago by Matt McClanahan

Severity: Normal
Type: Bug

comment:5 Changed 8 years ago by anonymous

Easy pickings: unset
Has patch: unset
UI/UX: unset

the patch for #11911 has been properly factored, a patch for this issue needs to be specifically attached

comment:6 Changed 7 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

In [17356]:

Fixed #12183 -- Made the urlize filter insert the nofollow attribute properly when an http: URL occurs after a mailto: URL. Thanks eronen for the report.

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