diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 9c7e67f4f..faca0d284 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -97,20 +97,22 @@ class Component extends Object { if (is_null($plugin) || !App::import('Component', $plugin . '.' . $component)) { if (!App::import('Component', $component)) { $this->cakeError('missingComponentFile', array(array( - 'className' => $this->controller->name, - 'component' => $component, - 'file' => Inflector::underscore($component) . '.php', - 'base' => $this->controller->base))); + 'className' => $this->controller->name, + 'component' => $component, + 'file' => Inflector::underscore($component) . '.php', + 'base' => $this->controller->base + ))); exit(); } } if (!class_exists($componentCn)) { $this->cakeError('missingComponentClass', array(array( - 'className' => $this->controller->name, - 'component' => $component, - 'file' => Inflector::underscore($component) . '.php', - 'base' => $this->controller->base))); + 'className' => $this->controller->name, + 'component' => $component, + 'file' => Inflector::underscore($component) . '.php', + 'base' => $this->controller->base + ))); exit(); } } diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 7e61f6aca..858e71c62 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -791,7 +791,7 @@ class AuthComponent extends Object { * @access public */ function password($password) { - return Security::hash(Configure::read('Security.salt') . $password); + return Security::hash($password, null, true); } /** * Component shutdown. If user is logged in, wipe out redirect. diff --git a/cake/libs/security.php b/cake/libs/security.php index 4b7a10350..67a6b379c 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -110,12 +110,18 @@ class Security extends Object { * * @param string $string String to hash * @param string $type Method to use (sha1/sha256/md5) + * @param boolean $salt If true, automatically appends the application's salt + * value to $string (Security.salt) * @return string Hash * @access public * @static */ - function hash($string, $type = null) { + function hash($string, $type = null, $salt = false) { $_this =& Security::getInstance(); + + if ($salt) { + $string = Configure::read('Security.salt') . $string; + } if (empty($type)) { $type = $_this->hashType; }