WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #33121, comment 16


Ignore:
Timestamp:
10/11/2018 03:55:00 PM (2 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33121, comment 16

    v1 v2  
    33Looking at `data--invaild="gone"` and `data-also-invaild-="gone"`, it seems having two hyphens or a hyphen as last char of the data-* attribute name is valid per https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-* and https://www.w3.org/TR/REC-xml/#NT-Name. Also seems quite a few chars are valid there, but still thinking we should only support `a-z0-9_-`.
    44
    5 Also `preg_match( '/^' . preg_quote( $prefix ) . '(-[a-z0-9_]+)*$/', $name_low )` would mean we don't allow attribute manes with two hyphens like `data-wp-id` (which is somewhat common).
     5Also `preg_match( '/^' . preg_quote( $prefix ) . '(-[a-z0-9_]+)*$/', $name_low )` would mean we don't allow attribute manes containing two hyphens like `data-wp-id` (which is somewhat common).