Opened 15 years ago
Closed 15 years ago
#10997 closed defect (bug) (fixed)
XHTML in comments_popup_link title attribute
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8.4 |
Component: | Comments | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
If a post title contains XHTML markup, the markup is included in the title attribute of the Comments link. See http://wordpress.org/support/topic/205790. To fix the problem, I suggest that line 973 in wp-includes/comments-template.php (version 2.8.5) be changed from
$title = esc_attr( get_the_title() );
to
$title = the_title_attribute('echo=0');
Attachments (2)
Change History (9)
#4
@
15 years ago
Here is a simple test to highlight the problem.
1) Using the default theme, make a new post with the title
The <em> tag adds <em>emphasis</em>
2) On the front page, mouse over the permalink made from the post title. The title attribute looks nice--no tags around the word 'emphasis'.
3) Mouse over the link to the post's comments. The title attribute looks messy because there are tags around the word 'emphasis' which obviously don't belong there.
Why aren't the links' title attributes consistent? Because the permalink uses the_title_attribute() to construct a clean title attribute (a function that seems to have been made expressly for that purpose), and comments_popup_link() does not.
If you use the search-everything plugin with highlighting enabled, search for any of the words in the post's title and witness the horror that is the title attribute of the comments link.
Changed the line described above