WordPress.org

Make WordPress Core

Changeset 45366


Ignore:
Timestamp:
05/20/2019 02:30:38 PM (6 months 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.
Merges [45365] to the 5.2 branch.
Fixes #47323.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-admin/includes/update-core.php

    r45358 r45366  
    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.