[wp-trac] [WordPress Trac] #9405: Shortcode parameter names can't have dashes in them

WordPress Trac noreply at wordpress.org
Tue Jul 1 23:01:48 UTC 2014


#9405: Shortcode parameter names can't have dashes in them
--------------------------+-----------------------
 Reporter:  Viper007Bond  |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  lowest        |   Milestone:
Component:  Shortcodes    |     Version:  2.8
 Severity:  minor         |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------
Changes (by sswells):

 * status:  closed => reopened
 * resolution:  invalid =>
 * component:  General => Shortcodes


Comment:

 Since the reasoning behind closing this ticket was the html attribute
 mirroring, can it be reconsidered now that data-uid and other data-?
 parameters are widely used?

 Line 308 of shortcodes.php could be changed from:
 $pattern =
 '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';

 to:
 $pattern =
 '/([\w\-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w\-]+)\s*=\s*\'([^\']*)\'(?:\s|$)|([\w\-]+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';

--
Ticket URL: <https://core.trac.wordpress.org/ticket/9405#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list