Throw an incorrect usage notice when the query argument of wpdb::prepare() does not include a placeholder.

props ounziw.
fixes #25604.

Built from https://develop.svn.wordpress.org/trunk@27073


git-svn-id: http://core.svn.wordpress.org/trunk@26946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-02-02 21:47:11 +00:00
parent 9f250b2ef7
commit 9c4a97c676

View File

@ -1053,6 +1053,10 @@ class wpdb {
if ( is_null( $query ) )
return;
if ( strpos( $query, '%' ) === false ) {
_doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s must have a placeholder.' ), 'wpdb::prepare()' ), '3.9' );
}
$args = func_get_args();
array_shift( $args );
// If args were passed as an array (as in vsprintf), move them up