[wp-trac] [WordPress Trac] #49955: Shortcode escaping not correctly handled when followed by enclosing shortcodes

WordPress Trac noreply at wordpress.org
Sun Apr 19 17:44:37 UTC 2020


#49955: Shortcode escaping not correctly handled when followed by enclosing
shortcodes
--------------------------+-----------------------------
 Reporter:  arildur       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Shortcodes    |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 There are some special situations when shortcode escaping is not correctly
 handled.

 This code will reproduce the error:
 {{{#!php
 <?php
 function ucase_shortcode($atts, $content) {
     return strtoupper($content);
 }
 add_shortcode('ucase', 'ucase_shortcode');
 }}}

 The following content:
 {{{
 This [[ucase]] shortcode [ucase]demonstrates[/ucase] the usage of
 enclosing shortcodes.
 }}}
 will produce this output:
 {{{
 This [] SHORTCODE [UCASE]DEMONSTRATES the usage of enclosing shortcodes.
 }}}
 but this would be expected:
 {{{
 This [ucase] shortcode DEMONSTRATES the usage of enclosing shortcodes.
 }}}

 It seems the escaped shortcode does not detect its ending double bracket,
 but just moves on until it finds an enclosing shortcode of same type.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49955>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list