mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 13:19:20 +01:00
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:
parent
9f250b2ef7
commit
9c4a97c676
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user