[wp-trac] Re: [WordPress Trac] #5120: _wp_unfiltered_html_comment breaks XHTML validity

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 4 20:39:44 GMT 2008


#5120: _wp_unfiltered_html_comment breaks XHTML validity
----------------------+-----------------------------------------------------
 Reporter:  jrawle    |        Owner:  anonymous
     Type:  defect    |       Status:  reopened 
 Priority:  normal    |    Milestone:           
Component:  Template  |      Version:  2.5      
 Severity:  normal    |   Resolution:           
 Keywords:            |  
----------------------+-----------------------------------------------------
Changes (by guillep2k):

  * status:  closed => reopened
  * version:  2.2.3 => 2.5
  * resolution:  invalid =>

Comment:

 It is true that the W3C validator doesn't mark it as an error, but the
 validator (even W3C's!) is not perfect. The HTML specification clearly
 states that all IDs must start with a letter at section 6.2
 (http://www.w3.org/TR/html401/types.html#type-id). For XHTML you have to
 dig a little deeper: at section 4.10 (http://www.w3.org/TR/xhtml1/#h-4.10)
 it says "in XHTML 1.0 the id attribute is defined to be of type ID"; then
 in XML specification you must follow the ID type
 (http://www.w3.org/TR/2000/REC-xml-20001006#id) to "Names and Tokens"
 (http://www.w3.org/TR/2000/REC-xml-20001006#NT-Name), where it says "[5]
 Name ::= (Letter | '_' | ':') (NameChar)*", ruling out IDs starting with
 underscores. Like user jrawle, I also think that the
 _wp_unfiltered_html_comment id breaks XHTML validity. In any case,
 changing it "to be 100% sure" wouldn't hurt. ;) The affected files are
 only two: wp-comments-post.php:38 and comment-template.php:610 (as of
 version 2.5).

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5120#comment:10>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list