adjacent_post_link fails to strip anchor tags from post titles
|Reported by:||jaylett||Owned by:|
Description (last modified by nacin)
If you create a post with a title of "Started using <a href='http://wordpress.org/'>WordPress</a>", adjacent_post_link() emits a link that has that entire string (including the anchor tags) inside its own link.
The expected behaviour would be to strip the anchor tag to leave the link generated to the WordPress post.
This would then match being able to put links in post titles and using template code such as <h2><?php the_title(); ?></h2> which results in a heading with the appropriate title including the link that is part of the title. (If you see what I mean.)
A (but possibly the wrong) fix is to strip the anchor tags using:
1265a1266,1268 $allowed_html_in_titles = $allowedtags; unset($allowed_html_in_titles['a']); $title = wp_kses($title, $allowed_html_in_titles);
applied to wp-includes/link-template.php
Change History (12)
- Description modified (diff)
- Milestone changed from Unassigned to 3.0