Opened 14 years ago

Closed 12 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

Description

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 by Russell Keith-Magee, 14 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by Tom Mortimer-Jones, 14 years ago

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 by Tom Mortimer-Jones, 14 years ago

Sorry that should have been ticket #11911.

comment:4 by Matt McClanahan, 13 years ago

Severity: Normal
Type: Bug

comment:5 by anonymous, 13 years ago

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 by Aymeric Augustin, 12 years ago

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