From 88464ecd41fde2b3138c049ac20afdbd0facedc2 Mon Sep 17 00:00:00 2001 From: "Aaron D. Campbell" Date: Tue, 19 Sep 2017 16:05:26 +0000 Subject: [PATCH] =?UTF-8?q?Database:=20Don=E2=80=99t=20trigger=20`=5Fdoing?= =?UTF-8?q?=5Fit=5Fwrong()`=20for=20null=20values=20in=20`wpdb::prepare()`?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/wp-includes/wp-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 5cc2be114f..c300e240f2 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -1243,7 +1243,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' ); } }