From 3514a5201959f26760c20eb226c93322eed7e0bc Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 19 Sep 2019 14:29:30 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@46185 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/update.php b/src/wp-admin/includes/update.php index c2b8a4257b..89cb1f858a 100644 --- a/src/wp-admin/includes/update.php +++ b/src/wp-admin/includes/update.php @@ -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; } }