Changeset 34894
- Timestamp:
- 10/07/2015 02:34:58 AM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r34846 r34894 993 993 return; 994 994 995 $protocol = $_SERVER['SERVER_PROTOCOL']; 996 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) 997 $protocol = 'HTTP/1.0'; 995 $protocol = wp_get_server_protocol(); 998 996 $status_header = "$protocol $code $description"; 999 997 if ( function_exists( 'apply_filters' ) ) -
trunk/src/wp-includes/load.php
r34828 r34894 7 7 * @package WordPress 8 8 */ 9 10 /** 11 * Return the HTTP protocol sent by the server. 12 * 13 * @since 4.4.0 14 * 15 * @return string The HTTP protocol. Default: HTTP/1.0. 16 */ 17 function wp_get_server_protocol() { 18 $protocol = $_SERVER['SERVER_PROTOCOL']; 19 if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) { 20 $protocol = 'HTTP/1.0'; 21 } 22 return $protocol; 23 } 9 24 10 25 /** … … 113 128 wp_load_translations_early(); 114 129 115 $protocol = $_SERVER['SERVER_PROTOCOL']; 116 if ( 'HTTP/1.1' !== $protocol && 'HTTP/1.0' !== $protocol ) { 117 $protocol = 'HTTP/1.0'; 118 } 130 $protocol = wp_get_server_protocol(); 119 131 header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 ); 120 132 header( 'Content-Type: text/html; charset=utf-8' ); … … 125 137 wp_load_translations_early(); 126 138 127 $protocol = $_SERVER['SERVER_PROTOCOL']; 128 if ( 'HTTP/1.1' !== $protocol && 'HTTP/1.0' !== $protocol ) { 129 $protocol = 'HTTP/1.0'; 130 } 139 $protocol = wp_get_server_protocol(); 131 140 header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 ); 132 141 header( 'Content-Type: text/html; charset=utf-8' ); … … 183 192 wp_load_translations_early(); 184 193 185 $protocol = $_SERVER["SERVER_PROTOCOL"]; 186 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) 187 $protocol = 'HTTP/1.0'; 194 $protocol = wp_get_server_protocol(); 188 195 header( "$protocol 503 Service Unavailable", true, 503 ); 189 196 header( 'Content-Type: text/html; charset=utf-8' );
Note: See TracChangeset
for help on using the changeset viewer.