Database: Don’t trigger `_doing_it_wrong()` for null values in `wpdb::prepare()`.
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.7 branch. Built from https://develop.svn.wordpress.org/branches/4.7@41485 git-svn-id: http://core.svn.wordpress.org/branches/4.7@41318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5b685405be
commit
8e19eed411
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7.6-alpha-41472';
|
||||
$wp_version = '4.7.6-alpha-41485';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
@ -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.7.6' );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue