[wp-trac] [WordPress Trac] #12135: language_attributes() generating invalid XHTML 1.1 code

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 5 06:52:26 UTC 2010


#12135: language_attributes() generating invalid XHTML 1.1 code
--------------------------+-------------------------------------------------
 Reporter:  shidouhikari  |       Owner:                                                      
     Type:  defect (bug)  |      Status:  new                                                 
 Priority:  normal        |   Milestone:  2.9.2                                               
Component:  Validation    |     Version:  2.9.1                                               
 Severity:  normal        |    Keywords:  language_attributes, XHTML, XHTML 1.1, doctype, MIME
--------------------------+-------------------------------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12135>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list