]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/shortcodes.php
WordPress 3.5.1-scripts
[autoinstalls/wordpress.git] / wp-includes / shortcodes.php
index 1cb361377972bf27e58c4408f813fc417341cbfb..2dfc2774502d1cabf5a436675b38ce645b34035e 100644 (file)
@@ -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()
-
-?>