Database: Don’t trigger `_doing_it_wrong()` for null values in `wpdb::prepare()`.

While `wpdb::prepare()` does not support null values (see #12819) they still appear in the wild like in the WordPress Importer and other plugins.

Merges [41483] to 4.8 branch.


Built from https://develop.svn.wordpress.org/branches/4.8@41484


git-svn-id: http://core.svn.wordpress.org/branches/4.8@41317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Campbell 2017-09-19 16:19:32 +00:00
parent 109695b948
commit 7b17c71213
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8.2-alpha-41471';
$wp_version = '4.8.2-alpha-41484';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -1306,7 +1306,7 @@ class wpdb {
}
foreach ( $args as $arg ) {
if ( ! is_scalar( $arg ) ) {
if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) {
_doing_it_wrong( 'wpdb::prepare', sprintf( 'Unsupported value type (%s).', gettype( $arg ) ), '4.8.2' );
}
}