Make WordPress Core


Ignore:
Timestamp:
10/31/2017 12:45:48 PM (9 years ago)
Author:
pento
Message:

Database: Restore numbered placeholders in wpdb::prepare().

[41496] removed support for numbered placeholders in queries send through wpdb::prepare(), which, despite being undocumented, were quite commonly used.

This change restores support for numbered placeholders (as well as a subset of placeholder formatting), while also adding extra checks to ensure the correct number of arguments are being passed to wpdb::prepare(), given the number of placeholders.

Merges [41662], [42056] to the 4.4 branch.
See #41925.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/tests/phpunit/tests/term/meta.php

    r35585 r42061  
    354354                register_taxonomy( 'wptests_tax', 'post' );
    355355                $t1 = wp_insert_term( 'Foo', 'wptests_tax' );
    356                 add_term_meta( $t1, 'foo', 'bar' );
     356                add_term_meta( $t1['term_id'], 'foo', 'bar' );
    357357
    358358                register_taxonomy( 'wptests_tax_2', 'post' );
Note: See TracChangeset for help on using the changeset viewer.