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