From 7b17c712139eb2d94586732647b5b358e10af264 Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Tue, 19 Sep 2017 16:19:32 +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.8 branch. Built from https://develop.svn.wordpress.org/branches/4.8@41484 git-svn-id: http://core.svn.wordpress.org/branches/4.8@41317 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/wp-db.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 7d50b18cfc..91b54ce8d4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8.2-alpha-41471'; +$wp_version = '4.8.2-alpha-41484'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 27c7cbd1eb..ffdcb217e2 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1306,7 +1306,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' ); } }