Make WordPress Core

Ticket #28575: 28575.patch

File 28575.patch, 964 bytes (added by SergeyBiryukov, 11 years ago)
  • src/wp-includes/formatting.php

     
    214214
    215215        $textarr = preg_split( $regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
    216216
    217         $do_times_check = ( 1 === preg_match( '/(?<=\d)x-?\d/', $text ) );
    218 
    219217        foreach ( $textarr as &$curl ) {
    220218                // Only call _wptexturize_pushpop_element if $curl is a delimeter.
    221219                $first = $curl[0];
     
    244242                        $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
    245243
    246244                        // 9x9 (times), but never 0x9999
    247                         if ( $do_times_check ) {
     245                        if ( 1 === preg_match( '/(?<=\d)x-?\d/', $curl ) ) {
    248246                                // Searching for a digit is 10 times more expensive than for the x, so we avoid doing this one!
    249247                                $curl = preg_replace( '/\b(\d(?(?<=0)[\d\.,]+|[\d\.,]*))x(-?\d[\d\.,]*)\b/', '$1&#215;$2', $curl );
    250248                        }