From 57eb45641e510a6b675bcbf49a536efc67b68255 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 28 Jun 2012 19:57:31 +0000 Subject: [PATCH] Handle localized floats in $wpdb->prepare(). props kurtpayne. fixes #19861. git-svn-id: https://develop.svn.wordpress.org/trunk@21161 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/wp-db.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index f418745929..3dc9411bfc 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -850,7 +850,8 @@ class wpdb { * @return void */ function escape_by_ref( &$string ) { - $string = $this->_real_escape( $string ); + if ( ! is_float( $string ) ) + $string = $this->_real_escape( $string ); } /** @@ -901,6 +902,7 @@ class wpdb { $args = $args[0]; $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting + $query = str_replace( '%f' , '%F', $query ); // Force floats to be locale unaware $query = preg_replace( '|(?