From 3fd1e051a736b26606b1f7118c0643102835a325 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 26 Jan 2014 21:09:47 +0100 Subject: Compatibilité PHP 5.4- MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/marienfressinaud/FreshRSS/issues/327#issuecomment-33328377 --- p/i/install.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p/i/install.php b/p/i/install.php index 331eda4ff..5addfb527 100644 --- a/p/i/install.php +++ b/p/i/install.php @@ -4,7 +4,7 @@ if (function_exists('opcache_reset')) { } require('../../constants.php'); -const BCRYPT_COST = 9; +define('BCRYPT_COST', 9); include(LIB_PATH . '/lib_rss.php'); @@ -170,6 +170,9 @@ function saveStep2 () { $_SESSION['default_user'] = substr(preg_replace('/[^a-zA-Z0-9]/', '', $_POST['default_user']), 0, 16); $_SESSION['auth_type'] = $_POST['auth_type']; if (!empty($_POST['passwordPlain'])) { + if (!function_exists('password_hash')) { + include_once(LIB_PATH . '/password_compat.php'); + } $passwordHash = password_hash($_POST['passwordPlain'], PASSWORD_BCRYPT, array('cost' => BCRYPT_COST)); $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js $_SESSION['passwordHash'] = $passwordHash; -- cgit v1.2.3