From 6abbb882f5336df871b3e27b0dc8453e813f2c06 Mon Sep 17 00:00:00 2001 From: gwoo Date: Wed, 6 Feb 2008 07:30:49 +0000 Subject: [PATCH] updating view error handling, fixes #4069 and fixes #4073, added long dash to escaped chr in http socket git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6439 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/http_socket.php | 2 +- cake/libs/view/view.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index a8c04a123..220312b80 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -931,7 +931,7 @@ class HttpSocket extends CakeSocket { if (!empty($chars)) { $escape = $chars; } else { - $escape = array('"', "(", ")", "<", ">", "@", ",", ";", ":", "\\", "/", "[", "]", "?", "=", "{", "}", " "); + $escape = array('"', "(", ")", "<", ">", "@", ",", ";", ":", "\\", "/", "[", "]", "?", "=", "{", "}", " ", "—"); for ($i = 0; $i <= 31; $i++) { $escape[] = chr($i); } diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 8ea901896..8a9ef0d18 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -400,7 +400,7 @@ class View extends Object { return $this->_render($file, array_merge($this->viewVars, $params), $loadHelpers); } - $file = $paths[0] . 'views' . DS . 'elements' . DS . $name . $this->ext; + $file = $paths[0] . 'elements' . DS . $name . $this->ext; if (Configure::read() > 0) { return "Not Found: " . $file; @@ -845,6 +845,10 @@ class View extends Object { * @return cakeError */ function _missingView($file, $error = 'missingView') { + if (Configure::read() == 0) { + $this->cakeError('error404'); + exit(); + } $paths = $this->_paths($this->plugin); $name = 'errors' . DS . Inflector::underscore($error);