Ticket #19861: 19861.2.patch
File 19861.2.patch, 1.6 KB (added by , 12 years ago) |
---|
-
wp-includes/wp-db.php
901 901 $args = $args[0]; 902 902 $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it 903 903 $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting 904 $query = str_replace( '%f' , '%F', $query ); // Force floats to be locale unaware 904 905 $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s 905 906 array_walk( $args, array( &$this, 'escape_by_ref' ) ); 906 907 return @vsprintf( $query, $args ); … … 1214 1215 $form = $this->field_types[$field]; 1215 1216 else 1216 1217 $form = '%s'; 1218 1219 if ( in_array( $form, array( '%f', '%F' ) ) ) 1220 $data[ $field ] = str_replace( ',', '.', $data[ $field ] ); 1221 1217 1222 $formatted_fields[] = $form; 1218 1223 } 1219 1224 $sql = "{$type} INTO `$table` (`" . implode( '`,`', $fields ) . "`) VALUES (" . implode( ",", $formatted_fields ) . ")"; … … 1254 1259 $form = $this->field_types[$field]; 1255 1260 else 1256 1261 $form = '%s'; 1262 1263 if ( in_array( $form, array( '%f', '%F' ) ) ) 1264 $data[ $field ] = str_replace( ',', '.', $data[ $field ] ); 1265 1257 1266 $bits[] = "`$field` = {$form}"; 1258 1267 } 1259 1268 … … 1265 1274 $form = $this->field_types[$field]; 1266 1275 else 1267 1276 $form = '%s'; 1277 1278 if ( in_array( $form, array( '%f', '%F' ) ) ) 1279 $where[ $field ] = str_replace( ',', '.', $where[ $field ] ); 1280 1268 1281 $wheres[] = "`$field` = {$form}"; 1269 1282 } 1270 1283