From 30570f494fc3bcafdb260179db4738542f5fca86 Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Tue, 19 Sep 2017 16:27:16 +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 3.9 branch. Built from https://develop.svn.wordpress.org/branches/3.9@41493 git-svn-id: http://core.svn.wordpress.org/branches/3.9@41326 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 a6027aa6be..5365940653 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1207,7 +1207,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 ) ), '3.9.20' ); } }