WordPress.org

Make WordPress Core

Changeset 41495


Ignore:
Timestamp:
09/19/2017 04:29:39 PM (4 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 3.7 branch.

Location:
branches/3.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/src

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

    r41482 r41495  
    10481048
    10491049        foreach ( $args as $arg ) {
    1050             if ( ! is_scalar( $arg ) ) {
     1050            if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) {
    10511051                _doing_it_wrong( 'wpdb::prepare', sprintf( 'Unsupported value type (%s).', gettype( $arg ) ), '3.7.22' );
    10521052            }
Note: See TracChangeset for help on using the changeset viewer.