Ticket #19308: miqro-19308.2.patch
File miqro-19308.2.patch, 1.4 KB (added by , 9 years ago) |
---|
-
src/wp-includes/formatting.php
173 173 // regular expressions 174 174 $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); 175 175 176 // 9x9 (times) 177 if ( 1 === preg_match( '/(?<=\d)x \d/', $text ) ) {176 // 9x9 (times), but never 0x9999 177 if ( 1 === preg_match( '/(?<=\d)x-?\d/', $text ) ) { 178 178 // Searching for a digit is 10 times more expensive than for the x, so we avoid doing this one! 179 $curl = preg_replace( '/\b(\d +)x(\d+)\b/', '$1×$2', $curl );179 $curl = preg_replace( '/\b(\d(?(?<=0)[\d\.,]+|[\d\.,]*))x(-?\d[\d\.,]*)\b/', '$1×$2', $curl ); 180 180 } 181 181 } 182 182 -
tests/phpunit/tests/formatting/WPTexturize.php
773 773 "12×34", 774 774 ), 775 775 array( 776 "-123x1=-123", 777 "-123×1=-123", 778 ), 779 array( 780 "-123x-1", 781 "-123×-1", 782 ), 783 array( 784 "0.675x1=0.675", 785 "0.675×1=0.675", 786 ), 787 array( 776 788 "9 x 9", 777 789 "9 x 9", 778 790 ), 791 array( 792 "0x70", 793 "0x70", 794 ), 795 array( 796 "3x2x1x0", 797 "3x2x1x0", 798 ), 779 799 ); 780 800 } 781 801