mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Making status description in Debug::friendlyError() compatible to HTTP 1.1 spec (removing any markup and newlines)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@106867 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
42ee289493
commit
4eb8a346a8
@ -317,7 +317,14 @@ class Debug {
|
||||
if(!$friendlyErrorMessage) $friendlyErrorMessage = self::$friendly_error_header;
|
||||
if(!$friendlyErrorDetail) $friendlyErrorDetail = self::$friendly_error_detail;
|
||||
|
||||
if(!headers_sent()) header($_SERVER['SERVER_PROTOCOL'] . " $statusCode $friendlyErrorMessage");
|
||||
if(!headers_sent()) {
|
||||
header(sprintf('%s %d %s',
|
||||
$_SERVER['SERVER_PROTOCOL'],
|
||||
$statusCode,
|
||||
// Ensure the error message complies with the HTTP 1.1 spec
|
||||
strip_tags(str_replace(array("\n", "\r"), '', $friendlyErrorMessage))
|
||||
));
|
||||
}
|
||||
|
||||
if(Director::is_ajax()) {
|
||||
echo $friendlyErrorMessage;
|
||||
|
Loading…
x
Reference in New Issue
Block a user