mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Send a 500 HTTP response code when the server's PHP or MySQL checks fail.
Fixes #33689 Props jeichorn Built from https://develop.svn.wordpress.org/trunk@34462 git-svn-id: http://core.svn.wordpress.org/trunk@34426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
652a3030e1
commit
bdcf5717de
@ -111,12 +111,24 @@ 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();
|
||||
|
||||
$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.' ) );
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34461';
|
||||
$wp_version = '4.4-alpha-34462';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user