From 08a8bd8e6f2ae339fbb29e01ffb002942e7a89f3 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 2 Feb 2014 14:11:32 +0100 Subject: [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 --- phpBB/phpbb/passwords/manager.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB') 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)) -- cgit v1.2.1