Changeset 28716 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 06/10/2014 01:54:11 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r28715 r28716 83 83 $static_replacements = array_merge( array( $em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ', 'xn--', '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace ); 84 84 85 /* 86 * Regex for common whitespace characters. 87 * 88 * By default, spaces include new lines, tabs, nbsp entities, and the UTF-8 nbsp. 89 * This is designed to replace the PCRE \s sequence. In #WP22692, that sequence 90 * was found to be unreliable due to random inclusion of the A0 byte. 91 */ 92 $spaces = '[\r\n\t ]|\xC2\xA0| '; 85 $spaces = wp_spaces_regexp(); 93 86 94 87 … … 371 364 372 365 $tagregexp = join( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) ); 366 $spaces = wp_spaces_regexp(); 373 367 374 368 $pattern = 375 369 '/' 376 370 . '<p>' // Opening paragraph 377 . ' \\s*+'// Optional leading whitespace371 . '(?:' . $spaces . ')*+' // Optional leading whitespace 378 372 . '(' // 1: The shortcode 379 373 . '\\[' // Opening bracket … … 400 394 . ')' 401 395 . ')' 402 . ' \\s*+'// optional trailing whitespace396 . '(?:' . $spaces . ')*+' // optional trailing whitespace 403 397 . '<\\/p>' // closing paragraph 404 398 . '/s'; … … 3858 3852 3859 3853 if ( empty( $spaces ) ) { 3854 /** 3855 * Regexp for common whitespace characters. 3856 * 3857 * This string is substituted for the \s sequence as needed in regular expressions. 3858 * For websites not written in English, different characters may represent whitespace. 3859 * For websites not encoded in UTF-8, the 0xC2 0xA0 sequence may not be in use. 3860 * 3861 * @since 4.0.0 3862 * 3863 * @param string $spaces 3864 */ 3860 3865 $spaces = apply_filters( 'wp_spaces_regexp', '[\r\n\t ]|\xC2\xA0| ' ); 3861 3866 }
Note: See TracChangeset
for help on using the changeset viewer.