id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses
4731 Inline tags in title attribute for post permalinks not stripped tarmiziaffandi "Defect in the default theme.
== Scenario ==
A WordPress (with the default theme active) user uses inline tags to format his post title: ""My example post"". But when he publishes the post, the resulting index page becomes XHTML invalid.
== Defect ==
Here is an excerpt of the page source containing the mentioned invalid markup:
Notice that the `title` attribute of the `a` element containing the permalink has inline HTML tags (`` and `` in this case), which comes from the post title, which are disallowed and considered invalid. The post title text itself is valid.
== Cause ==
The markup comes from this code in the default theme source (index.php, line 10):
The first `the_title()` WordPress tag outputs the raw post title, which may contains inline HTML tags, thus making the resulting markup invalid. These tags should be stripped.
== Suggested solution ==
The suggested solution to this problem is to strip any HTML tags resulting from the output of the the_title() tag in HTML attribute values (so that `My example post` becomes `My example post`). Here is my modification of the above code:
The following files contain similar problems:
* archive.php, line 36
* attachment.php, line 14
* search.php, line 18
* single.php, line 13
" defect (bug) closed highest omg bbq 2.3 Template 2.2.2 normal fixed has-patch dev-reviewed commit