merge r2052 from branch-1_7 to trunk

- 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/trunk@2053 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices 2007-07-07 02:10:11 +00:00
parent 1463bf2295
commit c946500244
2 changed files with 15 additions and 4 deletions

View file

@ -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);
}