Make WordPress Core


Ignore:
Timestamp:
10/31/2017 11:59:43 AM (8 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.

See #41925.

File:
1 edited

Legend:

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

    r41702 r42056  
    37553755 * is preparing an array for use in an IN clause.
    37563756 *
     3757 * NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string,
     3758 * this prevents certain SQLi attacks from taking place. This change in behaviour
     3759 * may cause issues for code that expects the return value of esc_sql() to be useable
     3760 * for other purposes.
     3761 *
    37573762 * @since 2.8.0
    37583763 *
Note: See TracChangeset for help on using the changeset viewer.