Make WordPress Core

Changeset 41483 for trunk


Ignore:
Timestamp:
09/19/2017 04:05:26 PM (7 years ago)
Author:
aaroncampbell
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r41470 r41483  
    12441244
    12451245        foreach ( $args as $arg ) {
    1246             if ( ! is_scalar( $arg ) ) {
     1246            if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) {
    12471247                _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' );
    12481248            }
Note: See TracChangeset for help on using the changeset viewer.