mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +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. Built from https://develop.svn.wordpress.org/trunk@52206 git-svn-id: http://core.svn.wordpress.org/trunk@51798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
40626108d0
commit
173a9cb89a
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-52205';
|
||||
$wp_version = '5.9-alpha-52206';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
@ -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…
Reference in New Issue
Block a user