Changeset 2052


Ignore:
Timestamp:
Jul 6, 2007, 3:04:50 AM (17 years ago)
Author:
rvelices
Message:
  • fix set_status_header for fastCGI installations that are strict in terms of http protocol (1.0 or 1.1)
Location:
branches/branch-1_7/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/include/functions_html.inc.php

    r1900 r2052  
    705705      case 403: $text='Forbidden';break;
    706706      case 404: $text='Not found';break;
    707     }
    708   }
    709   header("HTTP/1.1 $code $text");
    710   header("Status: $code $text");
     707      case 500: $text='Server error';break;
     708      case 503: $text='Service unavailable';break;
     709    }
     710  }
     711        $protocol = $_SERVER["SERVER_PROTOCOL"];
     712        if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) )
     713                $protocol = 'HTTP/1.0';
     714
     715        if ( version_compare( phpversion(), '4.3.0', '>=' ) )
     716  {
     717                header( "$protocol $code $text", true, $code );
     718        }
     719  else
     720  {
     721                header( "$protocol $code $text" );
     722        }
    711723  trigger_action('set_status_header', $code, $text);
    712724}
  • branches/branch-1_7/include/ws_core.inc.php

    r1900 r2052  
    381381    if ( is_null($this->_responseEncoder) )
    382382    {
    383       @header("HTTP/1.1 500 Server error");
    384       @header("Status: 500 Server error");
     383      set_status_header(500);
    385384      @header("Content-Type: text/plain");
    386385      echo ("Cannot process your request. Unknown response format.
Note: See TracChangeset for help on using the changeset viewer.