[wp-trac] [WordPress Trac] #9264: Self closing shortcodes

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 16 17:55:12 UTC 2009


#9264: Self closing shortcodes
--------------------------+-------------------------------------------------
 Reporter:  rb-cohen      |       Owner:  westi            
     Type:  defect (bug)  |      Status:  accepted         
 Priority:  normal        |   Milestone:  2.9              
Component:  Shortcodes    |     Version:  2.7.1            
 Severity:  normal        |    Keywords:  needs-patch early
--------------------------+-------------------------------------------------

Comment(by sebastien.barre):

 +1 / I second that. Even with the diff above, it seems to persist. I'm
 surprised it's not affecting more people; within the same page, you can't
 have the same shortcode with and without content.

 Example/Test:
 {{{
 function shortcode_test($atts, $content=null) {
   return '<p>Shortcode Test Content: {' . $content . '}</p>';
 }
 add_shortcode('test', 'shortcode_test');
 }}}

 Page:
 {{{
 [test/]
 [test]foobar[/test]
 }}}

 Output:
 {{{
 Shortcode Test Content: {
 [test]foobar}
 }}}

 i.e. the first short code completely swallowed the first half of the
 second shortcode. Is the regexp set to be "greedy"?

 Thanks

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


More information about the wp-trac mailing list