language_attributes() generating invalid XHTML 1.1 code
|Reported by:||shidouhikari||Owned by:|
As of 2.9.1, the function <code>language_attributes()</code> is on general-template.php line 1734.
When <code>get_option('html_type')</code> is set to <code>'text/html'</code>, and <code>$doctype</code> to <code>'xhtml'</code>, both ifs are triggered, resulting in <code>lang="en-US" xml:lang="en-US"</code>, which is invalid for XHTML 1.1.
Yes, I know XHTML should be served as application/xml+xhtml, but we should be able to deliver XHTML 1.1 as text/html too, the CMS shouldn't be what blocks it.
Also, seeing the logic of the code, if doctype is 'xhtml' it uses 'xml:lang', which alone is valid for any XHTML version (as long as I know). So, maybe these ifs should be excludents, and if <code>$doctype</code> is passed as 'xhtml' Wordpress only adds its xml:lang and moves on without even testing html_type.
Change History (5)
- Keywords language_attributes XHTML XHTML 1.1 doctype MIME removed
- Milestone 2.9.2 deleted
- Resolution set to wontfix
- Status changed from new to closed
comment:2 shidouhikari — 4 years ago
- Keywords has-patch added
- Milestone set to 2.9.2
- Resolution wontfix deleted
- Status changed from closed to reopened