Ticket #28575: 28575.patch
File 28575.patch, 964 bytes (added by , 11 years ago) |
---|
-
src/wp-includes/formatting.php
214 214 215 215 $textarr = preg_split( $regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); 216 216 217 $do_times_check = ( 1 === preg_match( '/(?<=\d)x-?\d/', $text ) );218 219 217 foreach ( $textarr as &$curl ) { 220 218 // Only call _wptexturize_pushpop_element if $curl is a delimeter. 221 219 $first = $curl[0]; … … 244 242 $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); 245 243 246 244 // 9x9 (times), but never 0x9999 247 if ( $do_times_check) {245 if ( 1 === preg_match( '/(?<=\d)x-?\d/', $curl ) ) { 248 246 // Searching for a digit is 10 times more expensive than for the x, so we avoid doing this one! 249 247 $curl = preg_replace( '/\b(\d(?(?<=0)[\d\.,]+|[\d\.,]*))x(-?\d[\d\.,]*)\b/', '$1×$2', $curl ); 250 248 }