Make WordPress Core


Ignore:
Timestamp:
05/20/2019 02:28:03 PM (6 years ago)
Author:
SergeyBiryukov
Message:

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.
Fixes #47323.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r45357 r45365  
    947947    }
    948948
    949     /* translators: %s: Update PHP page URL */
    950     $php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
    951 
    952     $annotation = wp_get_update_php_annotation();
    953     if ( $annotation ) {
    954         $php_update_message .= '</p><p><em>' . $annotation . '</em>';
     949    $php_update_message = '';
     950    if ( function_exists( 'wp_get_update_php_url' ) ) {
     951        /* translators: %s: Update PHP page URL */
     952        $php_update_message = '</p><p>' . sprintf( __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) );
     953
     954        if ( function_exists( 'wp_get_update_php_annotation' ) ) {
     955            $annotation = wp_get_update_php_annotation();
     956            if ( $annotation ) {
     957                $php_update_message .= '</p><p><em>' . $annotation . '</em>';
     958            }
     959        }
    955960    }
    956961
Note: See TracChangeset for help on using the changeset viewer.