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.



git-svn-id: https://develop.svn.wordpress.org/trunk@41483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Aaron D. Campbell 2017-09-19 16:05:26 +00:00
parent eb012314d0
commit 88464ecd41
1 changed files with 1 additions and 1 deletions

View File

@ -1243,7 +1243,7 @@ class wpdb {
} }
foreach ( $args as $arg ) { 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' ); _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' );
} }
} }