From d9da4028a2a5a597f563d1a09c68638ab5611bf3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 12 May 2007 21:55:14 +0000 Subject: [PATCH] Return proper protocol. fixes #3886 for 2.3 git-svn-id: https://develop.svn.wordpress.org/trunk@5460 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 1ae369c4c2..71eae710d7 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -931,14 +931,19 @@ function get_status_header_desc( $code ) { function status_header( $header ) { $text = get_status_header_desc( $header ); - if ( empty( $text ) ) { + if ( empty( $text ) ) 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 { - if ( version_compare( phpversion(), '4.3.0', '>=' ) ) { - return @header( "HTTP/1.1 $header $text", true, $header ); - } else { - return @header( "HTTP/1.1 $header $text" ); - } + return @header( $status_header ); } }