Ticket #22692: miqro-22692.4.patch
| File miqro-22692.4.patch, 3.3 KB (added by , 13 years ago) |
|---|
-
wp-includes/formatting.php
33 33 34 34 // No need to set up these static variables more than once 35 35 if ( ! isset( $static_characters ) ) { 36 // Spaces include new lines, tabs, nbsp entities, and the UTF-8 nbsp. 37 // Replaces the PCRE \s sequence per ticket #22692. 38 $spaces = apply_filters( 'texturize_spaces_regex', '[\r\n\t ]|\xC2\xA0| ' ); 39 36 40 /* translators: opening curly double quote */ 37 41 $opening_quote = _x( '“', 'opening curly double quote' ); 38 42 /* translators: closing curly double quote */ … … 73 77 $static_characters = array_merge( array( '---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)' ), $cockney ); 74 78 $static_replacements = array_merge( array( $em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ', 'xn--', '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace ); 75 79 80 // Pattern-based replacements of characters. 76 81 $dynamic = array(); 77 if ( "'" != $apos ) { 78 $dynamic[ '/\'(\d\d(?:’|\')?s)/' ] = $apos . '$1'; // '99's 79 $dynamic[ '/\'(\d)/' ] = $apos . '$1'; // '99 80 } 82 83 // '99s (apostrophe) 84 if ( "'" != $apos ) 85 $dynamic[ '/\'(?=\d)/' ] = $apos; 86 87 // Single quote at start, or preceded by (, {, <, [, ", or spaces. 81 88 if ( "'" != $opening_single_quote ) 82 $dynamic[ '/(\s|\A|[([{<]|")\'/' ] = '$1' . $opening_single_quote; // opening single quote, even after (, {, <, [ 89 $dynamic[ '/(?<=\A|[([{<"]|' . $spaces . ')\'/' ] = $opening_single_quote; 90 91 // 9" (double prime) 83 92 if ( '"' != $double_prime ) 84 $dynamic[ '/(\d)"/' ] = '$1' . $double_prime; // 9" (double prime) 93 $dynamic[ '/(?<=\d)"/' ] = $double_prime; 94 95 // 9' (prime) 85 96 if ( "'" != $prime ) 86 $dynamic[ '/(\d)\'/' ] = '$1' . $prime; // 9' (prime) 97 $dynamic[ '/(?<=\d)\'/' ] = $prime; 98 99 // Apostrophe in a word. No spaces or double primes. 87 100 if ( "'" != $apos ) 88 $dynamic[ '/(\S)\'([^\'\s])/' ] = '$1' . $apos . '$2'; // apostrophe in a word 101 $dynamic[ '/(?<!' . $spaces . ')\'(?!\'|' . $spaces . ')/' ] = $apos; 102 103 // Double quote at start, or preceded by (, {, <, [, or spaces, and not followed by spaces. 89 104 if ( '"' != $opening_quote ) 90 $dynamic[ '/(\s|\A|[([{<])"(?!\s)/' ] = '$1' . $opening_quote . '$2'; // opening double quote, even after (, {, <, [ 105 $dynamic[ '/(?<=\A|[([{<]|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote; 106 107 // Any remaining double quotes. 91 108 if ( '"' != $closing_quote ) 92 $dynamic[ '/"(\s|\S|\Z)/' ] = $closing_quote . '$1'; // closing double quote 109 $dynamic[ '/"/' ] = $closing_quote; 110 111 // Single quotes followed by spaces. 93 112 if ( "'" != $closing_single_quote ) 94 $dynamic[ '/\'( [\s.]|\Z)/' ] = $closing_single_quote . '$1'; // closing single quote113 $dynamic[ '/\'(?=\Z|' . $spaces . ')/' ] = $closing_single_quote; 95 114 96 $dynamic[ '/\b(\d+)x(\d+)\b/' ] = '$1×$2'; // 9x9 (times) 115 // 9x9 (times) 116 $dynamic[ '/\b(\d+)x(\d+)\b/' ] = '$1×$2'; 97 117 98 118 $dynamic_characters = array_keys( $dynamic ); 99 119 $dynamic_replacements = array_values( $dynamic );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)