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:
Ingo Schommer 2009-04-03 18:57:17 +00:00
parent 7d8186f247
commit c31a7e748a

View File

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