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