WordPress.org

Make WordPress Core

Ticket #7361: status-header.diff

File status-header.diff, 664 bytes (added by tenpura, 6 years ago)

Fixes HTTP status headers of PHP-CGI.

  • functions.php

     
    14731473        $protocol = $_SERVER["SERVER_PROTOCOL"]; 
    14741474        if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) 
    14751475                $protocol = 'HTTP/1.0'; 
    1476         $status_header = "$protocol $header $text"; 
     1476 
     1477        if('cgi' == substr(strtolower(php_sapi_name()), 0, 3)) 
     1478                $status_header = "Status: $header $text"; 
     1479        else 
     1480                $status_header = "$protocol $header $text"; 
     1481 
    14771482        if ( function_exists( 'apply_filters' ) ) 
    14781483                $status_header = apply_filters( 'status_header', $status_header, $header, $text, $protocol ); 
    14791484