Skip to content
Permalink
Browse files

Allow passing options to password_hash().

  • Loading branch information...
ADmad committed Jul 7, 2014
1 parent 8860e9b commit 4e4c1250b6fc0fa964db337fb996e06af622b9b8
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/Auth/DefaultPasswordHasher.php
@@ -9,7 +9,7 @@
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 2.4.0
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Auth;
@@ -28,7 +28,8 @@ class DefaultPasswordHasher extends AbstractPasswordHasher {
* @var array
*/
protected $_defaultConfig = [
'hashType' => PASSWORD_DEFAULT
'hashType' => PASSWORD_DEFAULT,
'hashOptions' => []
];
/**
@@ -39,7 +40,11 @@ class DefaultPasswordHasher extends AbstractPasswordHasher {
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#hashing-passwords
*/
public function hash($password) {
return password_hash($password, $this->_config['hashType']);
return password_hash(
$password,
$this->_config['hashType'],
$this->_config['hashOptions']
);
}
/**

0 comments on commit 4e4c125

Please sign in to comment.
You can’t perform that action at this time.