WordPress.org

Make WordPress Core

Ticket #22873: 22873.patch

File 22873.patch, 772 bytes (added by johnbillion, 2 years ago)

Patch to tell you you're _doing_it_wrong

  • wp-includes/wp-db.php

     
    987987         * @return null|false|string Sanitized query string, null if there is no query, false if there is an error and string 
    988988         *      if there was something to prepare 
    989989         */ 
    990         function prepare( $query, $args ) { 
     990        function prepare( $query, $args = null ) { 
    991991                if ( is_null( $query ) ) 
    992992                        return; 
    993993 
     994                if ( is_null( $args ) ) 
     995                        _doing_it_wrong( __METHOD__, sprintf( __( 'The %s parameter should not be empty.' ), '<code>$args</code>' ), '3.5' ); 
     996 
    994997                $args = func_get_args(); 
    995998                array_shift( $args ); 
    996999                // If args were passed as an array (as in vsprintf), move them up