Opened 5 years ago
Last modified 4 years ago
#49955 new defect (bug)
Shortcode escaping not correctly handled when followed by enclosing shortcodes
Reported by: | arildur | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Shortcodes | Keywords: | |
Focuses: | Cc: |
Description
There are some special situations when shortcode escaping is not correctly handled.
This code will reproduce the error:
<?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.
Change History (2)
Note: See
TracTickets for help on using
tickets.
I've confirmed that I see this behavior as well with the current trunk code by adding this testcase to
Tests_Shortcode