Changeset 33518 for branches/4.2/src/wp-includes/shortcodes.php
- Timestamp:
- 07/30/2015 07:40:33 PM (11 years ago)
- File:
-
- 1 edited
-
branches/4.2/src/wp-includes/shortcodes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/src/wp-includes/shortcodes.php
r33499 r33518 329 329 330 330 $pattern = get_shortcode_regex(); 331 332 $comment_regex = 333 '!' // Start of comment, after the <. 334 . '(?:' // Unroll the loop: Consume everything until --> is found. 335 . '-(?!->)' // Dash not followed by end of comment. 336 . '[^\-]*+' // Consume non-dashes. 337 . ')*+' // Loop possessively. 338 . '(?:-->)?'; // End of comment. If not found, match all input. 339 340 $regex = 341 '/(' // Capture the entire match. 342 . '<' // Find start of element. 343 . '(?(?=!--)' // Is this a comment? 344 . $comment_regex // Find end of comment. 345 . '|' 346 . '[^>]*>?' // Find end of element. If not found, match all input. 347 . ')' 348 . ')/s'; 349 350 $textarr = preg_split( $regex, $content, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); 331 $textarr = wp_html_split( $content ); 351 332 352 333 foreach ( $textarr as &$element ) { 353 if ( ' <' !== $element[0] ) {334 if ( '' == $element || '<' !== $element[0] ) { 354 335 continue; 355 336 } … … 366 347 } 367 348 368 if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) ) {349 if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) { 369 350 // Encode all [ and ] chars. 370 351 $element = strtr( $element, $trans );
Note: See TracChangeset
for help on using the changeset viewer.