Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/wp-includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,9 @@ function strip_shortcodes( $content ) {
function strip_shortcode_tag( $m ) {
// Allow [[foo]] syntax for escaping a tag.
if ( '[' === $m[1] && ']' === $m[6] ) {
return substr( $m[0], 1, -1 );
// Convert escaped shortcode to HTML entities to prevent unexpected execution
// when do_shortcode() is called later (e.g., in excerpt generation).
return '[' . substr( $m[0], 2, -2 ) . ']';
}

return $m[1] . $m[6];
Expand Down
Loading