mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
When replacing floats in wpdb::prepare(), avoid escaped placeholders (%%f). props SergeyBiryukov. fixes #19861.
git-svn-id: http://core.svn.wordpress.org/trunk@22304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1773a06874
commit
d85554c5f1
@ -998,7 +998,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( '|(?<!%)%f|' , '%F', $query ); // Force floats to be locale unaware
|
||||
$query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
|
||||
array_walk( $args, array( $this, 'escape_by_ref' ) );
|
||||
return @vsprintf( $query, $args );
|
||||
|
Loading…
Reference in New Issue
Block a user