mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed HTTPResponse->output() to only show Debug::friendlyError() if an error status code is set *and* the response body is empty. This prevented 404 ErrorPages to show in live modes, HTTPResponse always returned a generic "friendly" error
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@74068 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7d8186f247
commit
c31a7e748a
@ -188,7 +188,10 @@ class HTTPResponse extends Object {
|
||||
}
|
||||
}
|
||||
|
||||
if(Director::isLive() && $this->isError()) {
|
||||
// Only show error pages or generic "friendly" errors if the status code signifies
|
||||
// an error, and the response doesn't have any body yet that might contain
|
||||
// a more specific error description.
|
||||
if(Director::isLive() && $this->isError() && !$this->body) {
|
||||
Debug::friendlyError($this->statusCode, $this->getStatusDescription());
|
||||
} else {
|
||||
echo $this->body;
|
||||
|
Loading…
Reference in New Issue
Block a user