[wp-trac] [WordPress Trac] #17657: Shortcode regex doesn't allow for hyphens in shortcode name

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 6 05:27:53 UTC 2011


#17657: Shortcode regex doesn't allow for hyphens in shortcode name
-------------------------------------+------------------------------
 Reporter:  sivel                    |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Shortcodes               |     Version:  3.2
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------
Changes (by solarissmoke):

 * keywords:  needs-patch dev-feedback 2nd-opinion => has-patch needs-
               testing


Comment:

 The issue is in `get_shortcode_regex()` which uses the boundary assertion
 `\b` to check for the end of the shortcode tag. Unfortunately a hyphen
 counts as a word boundary. The solution seems quite simple - just replace
 that assertion with our own that allows hyphens - see patch.

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


More information about the wp-trac mailing list