diff --git a/wp-includes/version.php b/wp-includes/version.php index 6967ffd8b1..3e8480acf9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41457'; +$wp_version = '4.9-alpha-41470'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 57ed865a35..5cc2be114f 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1236,9 +1236,18 @@ class wpdb { $args = func_get_args(); array_shift( $args ); + // If args were passed as an array (as in vsprintf), move them up - if ( isset( $args[0] ) && is_array($args[0]) ) + if ( is_array( $args[0] ) && count( $args ) == 1 ) { $args = $args[0]; + } + + foreach ( $args as $arg ) { + if ( ! is_scalar( $arg ) ) { + _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' ); + } + } + $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting $query = preg_replace( '|(?