WordPress.org

Make WordPress Core

Ticket #37744: wpdb.diff

File wpdb.diff, 740 bytes (added by TJNowell, 4 years ago)

A diff to be applied to wp-db.php that adjusts the phpdocs of wpdb::prepare

  • wp-db.php

     
    12581258         *
    12591259         * Both %d and %s should be left unquoted in the query string.
    12601260         *
    1261          *     wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 )
    1262          *     wpdb::prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
     1261         *     $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 )
     1262         *     $wpdb->prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
    12631263         *
    12641264         * @link https://secure.php.net/sprintf Description of syntax.
    12651265         * @since 2.3.0