Make WordPress Core

Ticket #47169: 47169.patch

File 47169.patch, 1.7 KB (added by jrf, 5 years ago)

Proposed patch

  • src/wp-includes/load.php

    From ac54c8dbbd55909e4eeccbdcbdfb43478cba88c2 Mon Sep 17 00:00:00 2001
    Date: Tue, 7 May 2019 17:45:55 +0200
    Subject: [PATCH] Build: exit with error code 1 when WP requirements are not
     met
    
    ---
     src/wp-includes/load.php | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
    index 05d37f5a79..1821f053e3 100644
    a b function wp_check_php_mysql_versions() { 
    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' ) ) {
    function wp_check_php_mysql_versions() { 
    145146                $protocol = wp_get_server_protocol();
    146147                header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
    147148                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.' ) );
     149                echo __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' );
     150                exit( 1 );
    149151        }
    150152}
    151153