mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 23:57:41 +02:00
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.2 branch. Built from https://develop.svn.wordpress.org/branches/4.2@41490 git-svn-id: http://core.svn.wordpress.org/branches/4.2@41323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
be9edc6bc3
commit
79e0bb13d4
@ -1224,7 +1224,7 @@ class wpdb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $args as $arg ) {
|
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.2.16' );
|
_doing_it_wrong( 'wpdb::prepare', sprintf( 'Unsupported value type (%s).', gettype( $arg ) ), '4.2.16' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user