diff options
author | ctrlaltca <> | 2012-05-10 22:05:47 +0000 |
---|---|---|
committer | ctrlaltca <> | 2012-05-10 22:05:47 +0000 |
commit | 799832a5388260337567611dd2041fc19409a2f1 (patch) | |
tree | fea45e557bb305159f353e9bc39ca33cf5a3820a /framework/Exceptions | |
parent | 0b60336c37f91d79ecaefbe0f8b86cc324264451 (diff) |
fix for #400
Diffstat (limited to 'framework/Exceptions')
-rw-r--r-- | framework/Exceptions/TErrorHandler.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index 363bdecf..93f9c922 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -201,10 +201,19 @@ class TErrorHandler extends TModule '%%Time%%' => @strftime('%Y-%m-%d %H:%M',time())
);
+ $CGI=substr(php_sapi_name(), 0, 3) == 'cgi'; // FastCGI / IIS
if($isDebug)
- header("HTTP/1.0 $statusCode ".$exception->getMessage(), true, TPropertyValue::ensureInteger($statusCode));
- else
- header("HTTP/1.0 $statusCode", true, TPropertyValue::ensureInteger($statusCode));
+ {
+ if ($CGI)
+ header("Status: $statusCode ".$exception->getMessage(), true, TPropertyValue::ensureInteger($statusCode));
+ else
+ header("HTTP/1.0 $statusCode ".$exception->getMessage(), true, TPropertyValue::ensureInteger($statusCode));
+ } else {
+ if ($CGI)
+ header("Status: $statusCode", true, TPropertyValue::ensureInteger($statusCode));
+ else
+ header("HTTP/1.0 $statusCode", true, TPropertyValue::ensureInteger($statusCode));
+ }
echo strtr($content,$tokens);
}
|