]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/wp-db.php
WordPress 3.5.1
[autoinstalls/wordpress.git] / wp-includes / wp-db.php
index 391cfa4dc96fd6e027b539f059ac1245be20f18a..b3aa8f6d20fd7cd52bdeff95ce7f4dedb0cac3b2 100644 (file)
@@ -987,10 +987,13 @@ class wpdb {
         * @return null|false|string Sanitized query string, null if there is no query, false if there is an error and string
         *      if there was something to prepare
         */
-       function prepare( $query, $args ) {
+       function prepare( $query, $args = null ) {
                if ( is_null( $query ) )
                        return;
 
+               if ( func_num_args() < 2 )
+                       _doing_it_wrong( 'wpdb::prepare', 'wpdb::prepare() requires at least two arguments.', '3.5' );
+
                $args = func_get_args();
                array_shift( $args );
                // If args were passed as an array (as in vsprintf), move them up