Enforce a minimum of two arguments for wpdb::prepare(). The first argument is the query (or fragment thereof), which is required. Additional arguments are values to substitute into placeholders.
This will generate E_WARNINGs for insufficient arguments when prepare() is called with no additional arguments. This should discourage improper uses of prepare() under the guise of safely running a query. props xknown. fixes #22262. git-svn-id: http://core.svn.wordpress.org/trunk@22429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3a86c87c31
commit
e588812a49
|
@ -987,7 +987,7 @@ class wpdb {
|
||||||
* @return null|false|string Sanitized query string, null if there is no query, false if there is an error and string
|
* @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
|
* if there was something to prepare
|
||||||
*/
|
*/
|
||||||
function prepare( $query = null ) { // ( $query, *$args )
|
function prepare( $query, $args ) {
|
||||||
if ( is_null( $query ) )
|
if ( is_null( $query ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue