From 0ca1d61d9716e8fb63861a3fd00b89a5a810ca2d Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Tue, 19 Sep 2017 16:25:25 +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.3 branch. Built from https://develop.svn.wordpress.org/branches/4.3@41489 git-svn-id: http://core.svn.wordpress.org/branches/4.3@41322 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 febebaeca1..ce4474e5fa 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1225,7 +1225,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.3.12' ); } }