From 421a2116be49e9b6218278cf460ca05469a7923b Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 26 Sep 2011 22:00:58 -0400 Subject: [PATCH] Adding error code checking around CakeException handling SocketExceptions can have error codes outside of the HTTP values. --- lib/Cake/Error/ExceptionRenderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 6b4ede544..58a410d26 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -179,7 +179,7 @@ class ExceptionRenderer { */ protected function _cakeError(CakeException $error) { $url = $this->controller->request->here(); - $code = $error->getCode(); + $code = ($error->getCode() >= 400 && $error->getCode() < 506) ? $error->getCode() : 500; $this->controller->response->statusCode($code); $this->controller->set(array( 'code' => $code,