diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-02-02 14:11:32 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-02-02 14:13:21 +0100 |
commit | 08a8bd8e6f2ae339fbb29e01ffb002942e7a89f3 (patch) | |
tree | 04c96cb3772302921dc057b59925639d62832db9 /phpBB/phpbb/passwords | |
parent | [feature/passwords] Get rid of set_name/get_name methods for passwords drivers (diff) | |
download | phpbb-08a8bd8e6f2ae339fbb29e01ffb002942e7a89f3.tar.gz phpbb-08a8bd8e6f2ae339fbb29e01ffb002942e7a89f3.tar.bz2 phpbb-08a8bd8e6f2ae339fbb29e01ffb002942e7a89f3.zip |
[feature/passwords] Add support for passwords driver service name in hash()
This will allow users to specify both the hash type by prefix and by its
service name.
PHPBB3-11610
Diffstat (limited to 'phpBB/phpbb/passwords')
-rw-r--r-- | phpBB/phpbb/passwords/manager.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/phpBB/phpbb/passwords/manager.php b/phpBB/phpbb/passwords/manager.php index 7aeb496eb5..7f886e3d7d 100644 --- a/phpBB/phpbb/passwords/manager.php +++ b/phpBB/phpbb/passwords/manager.php @@ -205,6 +205,13 @@ class manager return false; } + // Try to retrieve algorithm by service name if type doesn't + // start with dollar sign + if (!is_array($type) && strpos($type, '$') !== 0 && isset($this->algorithms[$type])) + { + $type = $this->algorithms[$type]->get_prefix(); + } + $type = ($type === '') ? $this->type : $type; if (is_array($type)) |