WordPress.org

Make WordPress Core

Ticket #47169: 47169.2.patch

File 47169.2.patch, 1.9 KB (added by SergeyBiryukov, 11 months ago)
  • src/wp-includes/load.php

     
    130130        $php_version = phpversion();
    131131
    132132        if ( version_compare( $required_php_version, $php_version, '>' ) ) {
     133                require_once( ABSPATH . WPINC . '/functions.php' );
    133134                wp_load_translations_early();
    134135
    135                 $protocol = wp_get_server_protocol();
    136                 header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
    137                 header( 'Content-Type: text/html; charset=utf-8' );
    138                 /* translators: 1: Current PHP version number, 2: WordPress version number, 3: Minimum required PHP version number */
    139                 die( sprintf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version ) );
     136                wp_die(
     137                        /* translators: 1: Current PHP version number, 2: WordPress version number, 3: Minimum required PHP version number */
     138                        sprintf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version ),
     139                        __( 'Insufficient Requirements' )
     140                );
    140141        }
    141142
    142143        if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
     144                require_once( ABSPATH . WPINC . '/functions.php' );
    143145                wp_load_translations_early();
    144146
    145                 $protocol = wp_get_server_protocol();
    146                 header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
    147                 header( 'Content-Type: text/html; charset=utf-8' );
    148                 die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
     147                wp_die(
     148                        __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ),
     149                        __( 'Insufficient Requirements' )
     150                );
    149151        }
    150152}
    151153