mirror of
git://develop.git.wordpress.org/
synced 2025-03-23 05:20:01 +01:00
Database: Check if the $args[0]
value exists in wpdb::prepare()
before accessing it.
This avoids an `Undefined array key 0` PHP warning if no values are passed to the method besides the query string. Follow-up to [41470]. Props mjaschen. Fixes #54453. git-svn-id: https://develop.svn.wordpress.org/trunk@52206 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
041171cf83
commit
47d8c7313e
@ -1395,7 +1395,7 @@ class wpdb {
|
||||
|
||||
// If args were passed as an array (as in vsprintf), move them up.
|
||||
$passed_as_array = false;
|
||||
if ( is_array( $args[0] ) && count( $args ) === 1 ) {
|
||||
if ( isset( $args[0] ) && is_array( $args[0] ) && 1 === count( $args ) ) {
|
||||
$passed_as_array = true;
|
||||
$args = $args[0];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user