aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_html.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-07-06 01:04:50 +0000
committerrvelices <rv-github@modusoptimus.com>2007-07-06 01:04:50 +0000
commitc281046fcab94c02a085931f026159842791186a (patch)
tree29867a3257af3836ef8876cd185cb8944a38f771 /include/functions_html.inc.php
parent3d6fc7d9eafcb7f026b2f55ef39dcb5be14ae2ce (diff)
- fix set_status_header for fastCGI installations that are strict in terms of http protocol (1.0 or 1.1)
git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2052 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_html.inc.php')
-rw-r--r--include/functions_html.inc.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index db6d12710..1acdb15ad 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -704,10 +704,22 @@ function set_status_header($code, $text='')
case 401: $text='Authorization required';break;
case 403: $text='Forbidden';break;
case 404: $text='Not found';break;
+ case 500: $text='Server error';break;
+ case 503: $text='Service unavailable';break;
}
}
- header("HTTP/1.1 $code $text");
- header("Status: $code $text");
+ $protocol = $_SERVER["SERVER_PROTOCOL"];
+ if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) )
+ $protocol = 'HTTP/1.0';
+
+ if ( version_compare( phpversion(), '4.3.0', '>=' ) )
+ {
+ header( "$protocol $code $text", true, $code );
+ }
+ else
+ {
+ header( "$protocol $code $text" );
+ }
trigger_action('set_status_header', $code, $text);
}