PHP 7.4: Fix another instance of array access on a datatype that cannot be accessed as an array.

PHP 7.4 adds a warning when trying access a null/bool/int/float/resource (everything but array, string and object) as if it were an array.

Follow up of [45639].

Props desrosj, jrf.
See #47704.
Built from https://develop.svn.wordpress.org/trunk@46185


git-svn-id: http://core.svn.wordpress.org/trunk@45997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2019-09-19 14:30:56 +00:00
parent 66f907b2eb
commit 3d06de26a3
2 changed files with 2 additions and 2 deletions

View File

@ -707,7 +707,7 @@ function maintenance_nag() {
* This flag is cleared whenever a successful update occurs using Core_Upgrader.
*/
$comparison = ! empty( $failed['critical'] ) ? '>=' : '>';
if ( version_compare( $failed['attempted'], $wp_version, $comparison ) ) {
if ( isset( $failed['attempted'] ) && version_compare( $failed['attempted'], $wp_version, $comparison ) ) {
$nag = true;
}
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46184';
$wp_version = '5.3-alpha-46185';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.