Changeset 33525 for branches/3.7/src/wp-includes/shortcodes.php
- Timestamp:
- 07/31/2015 01:45:34 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7/src/wp-includes/shortcodes.php
r33389 r33525 320 320 321 321 $pattern = get_shortcode_regex(); 322 323 $comment_regex = 324 '!' // Start of comment, after the <. 325 . '(?:' // Unroll the loop: Consume everything until --> is found. 326 . '-(?!->)' // Dash not followed by end of comment. 327 . '[^\-]*+' // Consume non-dashes. 328 . ')*+' // Loop possessively. 329 . '(?:-->)?'; // End of comment. If not found, match all input. 330 331 $regex = 332 '/(' // Capture the entire match. 333 . '<' // Find start of element. 334 . '(?(?=!--)' // Is this a comment? 335 . $comment_regex // Find end of comment. 336 . '|' 337 . '[^>]*>?' // Find end of element. If not found, match all input. 338 . ')' 339 . ')/s'; 340 341 $textarr = preg_split( $regex, $content, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); 322 $textarr = wp_html_split( $content ); 342 323 343 324 foreach ( $textarr as &$element ) { 344 if ( ' <' !== $element[0] ) {325 if ( '' == $element || '<' !== $element[0] ) { 345 326 continue; 346 327 } … … 357 338 } 358 339 359 if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) ) {340 if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) { 360 341 // Encode all [ and ] chars. 361 342 $element = strtr( $element, $trans );
Note: See TracChangeset
for help on using the changeset viewer.