BUGFIX Making status description in Debug::friendlyError() compatible to HTTP 1.1 spec (removing any markup and newlines) (from r106867)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112540 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-10-15 03:06:31 +00:00
parent dcb402479a
commit 9b177ec458

View File

@ -319,11 +319,13 @@ class Debug {
if(!headers_sent()) {
$currController = Controller::curr();
// Ensure the error message complies with the HTTP 1.1 spec
$msg = strip_tags(str_replace(array("\n", "\r"), '', $friendlyErrorMessage));
if($currController) {
$response = $currController->getResponse();
$response->setStatusCode($statusCode, $friendlyErrorMessage);
$response->setStatusCode($statusCode, $msg);
} else {
header($_SERVER['SERVER_PROTOCOL'] . " $statusCode $friendlyErrorMessage");
header($_SERVER['SERVER_PROTOCOL'] . " $statusCode $msg");
}
}