[wp-trac] [WordPress Trac] #14376: admin post.php fails html validation due to use of "[" in name/id/for of hidden custom fields

WordPress Trac noreply at wordpress.org
Tue Dec 25 16:11:49 UTC 2012


#14376: admin post.php fails html validation due to use of  "[" in name/id/for of
hidden custom fields
--------------------------+-----------------------------
 Reporter:  anmari        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  lowest        |   Milestone:  Future Release
Component:  Validation    |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+-----------------------------
Description changed by SergeyBiryukov:

Old description:

> Post.php is causing many many html validation errors due to hidden screen
> reader text for post meta fields mainly. Not a major problem, but
> annoying when attempting to validate admin plugin code.
>
> eg:
>
> <label class='screen-reader-text' for='meta[1957][key]'>Key</label><input
> name='meta[1957][key]' id='meta[1957][key]' tabindex='6' type='text'
> size='20' value='_wp_geo_latitude' />
>
> character "[" is not allowed in the value of attribute "id"
> character "[" is not allowed in the value of attribute "for"
>
> "[" are allowed in the name attribute.  So perhaps one could simply strip
> them out them for the 'id' and the 'for'?
>
> Other failed validation messages that occur a lot and appear to be wp
> generated code:
> -   ID "_ajax_nonce" already defined
> -   reference to non-existent ID "metakeyselect"

New description:

 Post.php is causing many many html validation errors due to hidden screen
 reader text for post meta fields mainly. Not a major problem, but annoying
 when attempting to validate admin plugin code.

 eg:
 {{{
 <label class='screen-reader-text' for='meta[1957][key]'>Key</label><input
 name='meta[1957][key]' id='meta[1957][key]' tabindex='6' type='text'
 size='20' value='_wp_geo_latitude' />

 character "[" is not allowed in the value of attribute "id"
 character "[" is not allowed in the value of attribute "for"
 }}}
 "[" are allowed in the name attribute.  So perhaps one could simply strip
 them out them for the 'id' and the 'for'?

 Other failed validation messages that occur a lot and appear to be wp
 generated code:
 -   ID "_ajax_nonce" already defined
 -   reference to non-existent ID "metakeyselect"

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14376#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list