Skip to content
Permalink
Browse files

Upgrade/Install: As a follow-up to [45357], when linking to Update PH…

…P 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.

git-svn-id: https://develop.svn.wordpress.org/branches/5.2@45366 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed May 20, 2019
1 parent faa6d4b commit 62e03d5bb02dbdefce59706690f89cf0a2932aa1
Showing with 11 additions and 6 deletions.
  1. +11 −6 src/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 = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
$annotation = wp_get_update_php_annotation();
if ( $annotation ) {
$php_update_message .= '</p><p><em>' . $annotation . '</em>';
$php_update_message = '';
if ( function_exists( 'wp_get_update_php_url' ) ) {
/* translators: %s: Update PHP page URL */
$php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
if ( function_exists( 'wp_get_update_php_annotation' ) ) {
$annotation = wp_get_update_php_annotation();
if ( $annotation ) {
$php_update_message .= '</p><p><em>' . $annotation . '</em>';
}
}
}
if ( ! $mysql_compat && ! $php_compat ) {

0 comments on commit 62e03d5

Please sign in to comment.
You can’t perform that action at this time.