X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/38ac4bc40322ecdc4052db4263466573e01fa51f..6359b807ff8b4ffa151d8756cdefb861c6c1d4db:/wp-includes/shortcodes.php diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 2661201b..531a1fa1 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -328,29 +328,10 @@ function do_shortcodes_in_html_tags( $content, $ignore_html ) { $trans = array( '[' => '[', ']' => ']' ); $pattern = get_shortcode_regex(); - - $comment_regex = - '!' // Start of comment, after the <. - . '(?:' // Unroll the loop: Consume everything until --> is found. - . '-(?!->)' // Dash not followed by end of comment. - . '[^\-]*+' // Consume non-dashes. - . ')*+' // Loop possessively. - . '(?:-->)?'; // End of comment. If not found, match all input. - - $regex = - '/(' // Capture the entire match. - . '<' // Find start of element. - . '(?(?=!--)' // Is this a comment? - . $comment_regex // Find end of comment. - . '|' - . '[^>]*>?' // Find end of element. If not found, match all input. - . ')' - . ')/s'; - - $textarr = preg_split( $regex, $content, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); + $textarr = wp_html_split( $content ); foreach ( $textarr as &$element ) { - if ( '<' !== $element[0] ) { + if ( '' == $element || '<' !== $element[0] ) { continue; } @@ -365,7 +346,7 @@ function do_shortcodes_in_html_tags( $content, $ignore_html ) { continue; } - if ( $ignore_html || '