aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/passwords/driver
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/passwords/driver')
-rw-r--r--phpBB/phpbb/passwords/driver/bcrypt.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/phpbb/passwords/driver/bcrypt.php b/phpBB/phpbb/passwords/driver/bcrypt.php
index b16d2ada56..1d1b1e267d 100644
--- a/phpBB/phpbb/passwords/driver/bcrypt.php
+++ b/phpBB/phpbb/passwords/driver/bcrypt.php
@@ -29,8 +29,9 @@ class bcrypt extends base
*/
public function hash($password, $salt = '')
{
- // Get prefix of this driver
- $prefix = $this->get_prefix();
+ // The 2x and 2y prefixes of bcrypt might not be supported
+ // Revert to 2a if this is the case
+ $prefix = (!$this->is_supported()) ? '$2a$' : $this->get_prefix();
// Do not support 8-bit characters with $2a$ bcrypt
// Also see http://www.php.net/security/crypt_blowfish.php