X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..baca9ce86a38dc54c4574890ee2d352fd81f78b2:/wp-includes/shortcodes.php diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 1b860d27..2dfc2774 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -177,11 +177,12 @@ function get_shortcode_regex() { $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag() + // Also, see shortcode_unautop() and shortcode.js. return '\\[' // Opening bracket . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]] . "($tagregexp)" // 2: Shortcode name - . '\\b' // Word boundary + . '(?![\\w-])' // Not followed by word character or hyphen . '(' // 3: Unroll the loop: Inside the opening shortcode tag . '[^\\]\\/]*' // Not a closing bracket or forward slash . '(?:'