mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Send a 500 HTTP response code when the server's PHP or MySQL checks fail.
Fixes #33689 Props jeichorn git-svn-id: https://develop.svn.wordpress.org/trunk@34462 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a87b30da21
commit
1ce18f6e95
@ -111,13 +111,25 @@ function wp_check_php_mysql_versions() {
|
||||
|
||||
if ( version_compare( $required_php_version, $php_version, '>' ) ) {
|
||||
wp_load_translations_early();
|
||||
|
||||
$protocol = $_SERVER['SERVER_PROTOCOL'];
|
||||
if ( 'HTTP/1.1' !== $protocol && 'HTTP/1.0' !== $protocol ) {
|
||||
$protocol = 'HTTP/1.0';
|
||||
}
|
||||
header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
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 ) );
|
||||
}
|
||||
|
||||
if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
|
||||
wp_load_translations_early();
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
|
||||
$protocol = $_SERVER['SERVER_PROTOCOL'];
|
||||
if ( 'HTTP/1.1' !== $protocol && 'HTTP/1.0' !== $protocol ) {
|
||||
$protocol = 'HTTP/1.0';
|
||||
}
|
||||
header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user