Changeset 28719
- Timestamp:
- 06/10/2014 02:17:24 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r28718 r28719 181 181 $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); 182 182 183 // 9x9 (times) 184 if ( 1 === preg_match( '/(?<=\d)x \d/', $text ) ) {183 // 9x9 (times), but never 0x9999 184 if ( 1 === preg_match( '/(?<=\d)x-?\d/', $text ) ) { 185 185 // Searching for a digit is 10 times more expensive than for the x, so we avoid doing this one! 186 $curl = preg_replace( '/\b(\d +)x(\d+)\b/', '$1×$2', $curl );186 $curl = preg_replace( '/\b(\d(?(?<=0)[\d\.,]+|[\d\.,]*))x(-?\d[\d\.,]*)\b/', '$1×$2', $curl ); 187 187 } 188 188 } -
trunk/tests/phpunit/tests/formatting/WPTexturize.php
r28718 r28719 782 782 ), 783 783 array( 784 "-123x1=-123", 785 "-123×1=-123", 786 ), 787 array( 788 "-123x-1", 789 "-123×-1", 790 ), 791 array( 792 "0.675x1=0.675", 793 "0.675×1=0.675", 794 ), 795 array( 784 796 "9 x 9", 785 797 "9 x 9", 786 798 ), 799 array( 800 "0x70", 801 "0x70", 802 ), 803 array( 804 "3x2x1x0", 805 "3x2x1x0", 806 ), 787 807 ); 788 808 }
Note: See TracChangeset
for help on using the changeset viewer.