We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d24041 commit c324f86Copy full SHA for c324f86
src/wp-includes/shortcodes.php
@@ -757,7 +757,9 @@ function strip_shortcodes( $content ) {
757
function strip_shortcode_tag( $m ) {
758
// Allow [[foo]] syntax for escaping a tag.
759
if ( '[' === $m[1] && ']' === $m[6] ) {
760
- return substr( $m[0], 1, -1 );
+ // Convert escaped shortcode to HTML entities to prevent unexpected execution
761
+ // when do_shortcode() is called later (e.g., in excerpt generation).
762
+ return '[' . substr( $m[0], 2, -2 ) . ']';
763
}
764
765
return $m[1] . $m[6];
0 commit comments