Skip to content

Commit

Permalink
PHP 7.4: Fix another instance of array access on a datatype that cann…
Browse files Browse the repository at this point in the history
…ot 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
  • Loading branch information
desrosj committed Sep 19, 2019
1 parent b926baa commit 3514a52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-admin/includes/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 3514a52

Please sign in to comment.