Return proper protocol. fixes #3886 for 2.3

git-svn-id: http://svn.automattic.com/wordpress/trunk@5460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-05-12 21:55:14 +00:00
parent 24399dcbfb
commit b820d101d6
1 changed files with 11 additions and 6 deletions

View File

@ -931,14 +931,19 @@ function get_status_header_desc( $code ) {
function status_header( $header ) { function status_header( $header ) {
$text = get_status_header_desc( $header ); $text = get_status_header_desc( $header );
if ( empty( $text ) ) { if ( empty( $text ) )
return false; return false;
$protocol = $_SERVER["SERVER_PROTOCOL"];
if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) )
$protocol = 'HTTP/1.0';
$status_header = "$protocol $header $text";
$status_header = apply_filters('status_header', $status_header, $header, $text, $protocol);
if ( version_compare( phpversion(), '4.3.0', '>=' ) ) {
return @header( $status_header, true, $header );
} else { } else {
if ( version_compare( phpversion(), '4.3.0', '>=' ) ) { return @header( $status_header );
return @header( "HTTP/1.1 $header $text", true, $header );
} else {
return @header( "HTTP/1.1 $header $text" );
}
} }
} }