From ce78b2a4fb7056ddac047ffba10fceed4039cffe Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Tue, 19 Sep 2017 16:21:34 +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. Merges [41483] to 4.6 branch. Built from https://develop.svn.wordpress.org/branches/4.6@41486 git-svn-id: http://core.svn.wordpress.org/branches/4.6@41319 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/wp-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 9248a6e45d..40508bdb0e 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1305,7 +1305,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.6.7' ); } }