Ticket #3886: status_header.diff

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

    old new  
    915915        elseif ( 410 == $header ) 
    916916                $text = 'Gone'; 
    917917 
     918        $protocol = trim($_SERVER["SERVER_PROTOCOL"]); 
     919        if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) ) 
     920                $protocol = 'HTTP/1.1'; 
     921        $status_header = "$protocol $header $text"; 
     922        $status_header = apply_filters('status_header', $status_header, $header, $text, $protocol); 
    918923        if ( version_compare(phpversion(), '4.3.0', '>=') ) 
    919                 @header("HTTP/1.1 $header $text", true, $header); 
     924                @header($status_header, true, $header); 
    920925        else 
    921                 @header("HTTP/1.1 $header $text"); 
     926                @header($status_header); 
    922927} 
    923928 
    924929function nocache_headers() {