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