From 0b06068330d3fe4471cd05351624d09659b46eae Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 9 Mar 2025 15:15:05 +0000 Subject: [PATCH] Upgrade/Install: Adjust the check for missing extensions during an upgrade so it remains compatible with versions of WordPress prior to 5.1. The `WP_Error::has_errors()` method was introduced in WordPress 5.1, so this change uses its internal logic instead to remain compatible with earlier versions. Props swissspidy, joemcgill, desrosj. Fixes #63052 git-svn-id: https://develop.svn.wordpress.org/trunk@59956 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/upgrade-develop-testing.yml | 6 +++++- src/wp-admin/includes/update-core.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index edb57bc8d6..7b7d0734f4 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -63,13 +63,17 @@ jobs: php: [ '7.2', '8.4' ] db-type: [ 'mysql' ] db-version: [ '5.7', '8.4' ] - wp: [ '6.5', '6.6', '6.7' ] + # WordPress 4.9 is the oldest version that supports PHP 7.2. + wp: [ '4.9', '6.5', '6.6', '6.7' ] multisite: [ false, true ] exclude: # The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218. - php: '7.2' db-version: '8.4' + # WordPress 4.9 does not support PHP 8.4. + - php: '8.4' + wp: '4.9' with: os: ${{ matrix.os }} php: ${{ matrix.php }} diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index 2c05d16188..b249c11275 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1199,7 +1199,7 @@ function update_core( $from, $to ) { } // Add a warning when required PHP extensions are missing. - if ( $missing_extensions->has_errors() ) { + if ( ! empty( $missing_extensions->errors ) ) { return $missing_extensions; } }