From 64e67b0dbb9a2b19c11a5382b2dd2427f511f632 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 22 Jun 2014 22:13:16 +0000 Subject: [PATCH] Revert [28776] and use a correct variable instead. props miqrogroove. fixes #28575. Built from https://develop.svn.wordpress.org/trunk@28802 git-svn-id: http://core.svn.wordpress.org/trunk@28611 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 9a623896c8..9d93817e64 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -214,8 +214,6 @@ function wptexturize($text, $reset = false) { $textarr = preg_split( $regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); - $do_times_check = ( 1 === preg_match( '/(?<=\d)x-?\d/', $text ) ); - foreach ( $textarr as &$curl ) { // Only call _wptexturize_pushpop_element if $curl is a delimeter. $first = $curl[0]; @@ -244,7 +242,7 @@ function wptexturize($text, $reset = false) { $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); // 9x9 (times), but never 0x9999 - if ( $do_times_check ) { + if ( 1 === preg_match( '/(?<=\d)x-?\d/', $curl ) ) { // Searching for a digit is 10 times more expensive than for the x, so we avoid doing this one! $curl = preg_replace( '/\b(\d(?(?<=0)[\d\.,]+|[\d\.,]*))x(-?\d[\d\.,]*)\b/', '$1×$2', $curl ); }