X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/5aa86a9053fb0fa15846bb60aac2fb8fdfff524a..80e421fa26a0ef412d7c67749a64a6c1919d515a:/wp-includes/shortcodes.php diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 1cb36137..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 . '(?:' @@ -235,7 +236,7 @@ function do_shortcode_tag( $m ) { return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, $m[5], $tag ) . $m[6]; } else { // self-closing tag - return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, NULL, $tag ) . $m[6]; + return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, null, $tag ) . $m[6]; } } @@ -332,5 +333,3 @@ function strip_shortcode_tag( $m ) { } add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop() - -?>