WordPress.org

Make WordPress Core

Ticket #47169: 47169.3.patch

File 47169.3.patch, 1.6 KB (added by spacedmonkey, 13 months ago)
  • src/wp-includes/load.php

     
    136136                header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
    137137                header( 'Content-Type: text/html; charset=utf-8' );
    138138                /* 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 ) );
     139                printf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version );
     140                exit( 1 );
    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();
    144 
    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.' ) );
     146                $args = array(
     147                        'exit' => false,
     148                        'code' => 'mysql_not_found',
     149                );
     150                wp_die(
     151                        __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ),
     152                        __( 'Insufficient Requirements' ),
     153                        $args
     154                );
     155                exit( 1 );
    149156        }
    150157}
    151158