Don't quote escaped strings. Props dd32. see #11608

git-svn-id: http://svn.automattic.com/wordpress/trunk@13357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-02-24 05:30:34 +00:00
parent fc250d46f3
commit efe8a967be
1 changed files with 1 additions and 1 deletions

View File

@ -864,7 +864,7 @@ class wpdb {
$args = $args[0]; $args = $args[0];
$query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
$query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
$query = str_replace( '%s', "'%s'", $query ); // quote the strings $query = preg_replace('|(?<!%)%s|', "'%s'", $query); // quote the strings, avoiding escaped strings like %%s
array_walk( $args, array( &$this, 'escape_by_ref' ) ); array_walk( $args, array( &$this, 'escape_by_ref' ) );
return @vsprintf( $query, $args ); return @vsprintf( $query, $args );
} }