Changeset 33469 for trunk/src/wp-includes/shortcodes.php
- Timestamp:
- 07/28/2015 11:02:04 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/shortcodes.php
r33359 r33469 334 334 335 335 $pattern = get_shortcode_regex(); 336 337 $comment_regex = 338 '!' // Start of comment, after the <. 339 . '(?:' // Unroll the loop: Consume everything until --> is found. 340 . '-(?!->)' // Dash not followed by end of comment. 341 . '[^\-]*+' // Consume non-dashes. 342 . ')*+' // Loop possessively. 343 . '(?:-->)?'; // End of comment. If not found, match all input. 344 345 $regex = 346 '/(' // Capture the entire match. 347 . '<' // Find start of element. 348 . '(?(?=!--)' // Is this a comment? 349 . $comment_regex // Find end of comment. 350 . '|' 351 . '[^>]*>?' // Find end of element. If not found, match all input. 352 . ')' 353 . ')/s'; 354 355 $textarr = preg_split( $regex, $content, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); 336 $textarr = wp_html_split( $content ); 356 337 357 338 foreach ( $textarr as &$element ) { 358 if ( ' <' !== $element[0] ) {339 if ( '' == $element || '<' !== $element[0] ) { 359 340 continue; 360 341 } … … 371 352 } 372 353 373 if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) ) {354 if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) { 374 355 // Encode all [ and ] chars. 375 356 $element = strtr( $element, $trans );
Note: See TracChangeset
for help on using the changeset viewer.