#9959 closed defect (bug) (fixed)
wp_rel_nofollow_callback adds too many rel/nofollow attributes
Reported by: | Denis-de-Bernardy | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.4 | Priority: | low |
Severity: | normal | Version: | 2.8 |
Component: | Comments | Keywords: | has-patch needs-unit-tests |
Focuses: | Cc: |
Description
if you insert a link in a comment, like:
<a href="foo" rel="bar nofollow">
wp_rel_nofollow_callback() turns that into:
<a href="foo" rel="bar nofollow" rel="nofollow">
Here's a correct implementation of a strip_nofollow() function:
http://plugins.trac.wordpress.org/browser/sem-dofollow/trunk/sem-dofollow.php
We'd probably want to do the same in WP, and then reverse it: add rel=nofollow if no rel is present, and add a nofollow to the rel if it's not in there already.
Attachments (4)
Change History (21)
#10
follow-up:
↓ 13
@
15 years ago
per IRC discussion, there also is a separate issue. unless I'm mistaking, it's possible to add a link in a comment without nofollow, as such:
<a href="url">
#13
in reply to:
↑ 10
@
13 years ago
- Cc dilbert4life added
Replying to Denis-de-Bernardy:
To prevent that, we could have it remove line breaks from the comment text, and then run the wp_rel_nofollow function. However, the original problem is still present in 3.1.1. I'll look into this using 9959.patch as a starting point.
Some test data to play with