mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
dcb402479a
commit
9b177ec458
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user