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.4 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.4@41488 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Aaron D. Campbell 2017-09-19 16:22:48 +00:00
parent a577ca8fcd
commit 4ca6de4825

View File

@ -1261,7 +1261,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.4.11' );
}
}