Ticket #3886: status_header.2.diff

File status_header.2.diff, 1.0 kB (added by ryan, 2 years ago)
  • wp-includes/functions.php

    old new  
    931931function status_header( $header ) { 
    932932        $text = get_status_header_desc( $header ); 
    933933         
    934         if ( empty( $text ) ) { 
     934        if ( empty( $text ) ) 
    935935                return false; 
     936 
     937        $protocol = $_SERVER["SERVER_PROTOCOL"]; 
     938        if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) ) 
     939                $protocol = 'HTTP/1.1'; 
     940        $status_header = "$protocol $header $text"; 
     941        $status_header = apply_filters('status_header', $status_header, $header, $text, $protocol); 
     942 
     943        if ( version_compare( phpversion(), '4.3.0', '>=' ) ) { 
     944                return @header( $status_header, true, $header ); 
    936945        } else { 
    937                 if ( version_compare( phpversion(), '4.3.0', '>=' ) ) { 
    938                         return @header( "HTTP/1.1 $header $text", true, $header ); 
    939                 } else { 
    940                         return @header( "HTTP/1.1 $header $text" ); 
    941                 } 
     946                return @header( $status_header ); 
    942947        } 
    943948} 
    944949