From da22a1cc85ed8221648205bf6867361db07d9611 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 20 May 2019 14:32:02 +0000 Subject: [PATCH] Upgrade/Install: As a follow-up to [45357], when linking to Update PHP support page in error messages, check if `wp_get_update_php_url()` and `wp_get_update_php_annotation()` exist. `wp-admin/includes/update-core.php` runs in the context of the previous WordPress version. Any calls to newly introduced functions there need to be checked via `function_exists()`. Reviewed by desrosj, earnjam, SergeyBiryukov. Props dd32, imath. Merges [45365] to the 5.2 branch. Fixes #47323. Built from https://develop.svn.wordpress.org/branches/5.2@45366 git-svn-id: http://core.svn.wordpress.org/branches/5.2@45177 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 15 ++++++++++----- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 02461acf8c..d1282fa6e2 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -946,12 +946,17 @@ function update_core( $from, $to ) { $wp_filesystem->delete( $from, true ); } - /* translators: %s: Update PHP page URL */ - $php_update_message = '

' . sprintf( __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); + $php_update_message = ''; + if ( function_exists( 'wp_get_update_php_url' ) ) { + /* translators: %s: Update PHP page URL */ + $php_update_message = '

' . sprintf( __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); - $annotation = wp_get_update_php_annotation(); - if ( $annotation ) { - $php_update_message .= '

' . $annotation . ''; + if ( function_exists( 'wp_get_update_php_annotation' ) ) { + $annotation = wp_get_update_php_annotation(); + if ( $annotation ) { + $php_update_message .= '

' . $annotation . ''; + } + } } if ( ! $mysql_compat && ! $php_compat ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 39f8c5ab1b..1cb9c6ed10 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2.1-RC1-45364'; +$wp_version = '5.2.1-RC1-45366'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.