Bootstrap/Load: In `wp_get_server_protocol()`, check if `$_SERVER['SERVER_PROTOCOL']` is defined, to avoid a notice in CLI context.

Props thakkarhardik, malthert.
Fixes #47005.
Built from https://develop.svn.wordpress.org/trunk@45400


git-svn-id: http://core.svn.wordpress.org/trunk@45211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-05-24 01:47:51 +00:00
parent 729d4a4942
commit 27720e15a7
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@
* @return string The HTTP protocol. Default: HTTP/1.0. * @return string The HTTP protocol. Default: HTTP/1.0.
*/ */
function wp_get_server_protocol() { function wp_get_server_protocol() {
$protocol = $_SERVER['SERVER_PROTOCOL']; $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : '';
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) { if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) {
$protocol = 'HTTP/1.0'; $protocol = 'HTTP/1.0';
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-45399'; $wp_version = '5.3-alpha-45400';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.