Make WordPress Core

Changeset 41492


Ignore:
Timestamp:
09/19/2017 04:24:51 PM (8 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.

Merges [41483] to 4.0 branch.

Location:
branches/4.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/wp-db.php

    r41479 r41492  
    12151215
    12161216        foreach ( $args as $arg ) {
    1217             if ( ! is_scalar( $arg ) ) {
     1217            if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) {
    12181218                _doing_it_wrong( 'wpdb::prepare', sprintf( 'Unsupported value type (%s).', gettype( $arg ) ), '4.0.19' );
    12191219            }
Note: See TracChangeset for help on using the changeset viewer.