From 0d08ac418a10eac4e0331df1e4dce81f8209cafc Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Wed, 29 Sep 2021 11:52:31 +0100 Subject: [PATCH] see https://github.com/postfixadmin/postfixadmin/issues/547 --- functions.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 4626a396..8764638b 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -958,8 +958,10 @@ function _pacrypt_crypt($pw, $pw_db = '') if ($pw_db) { return crypt($pw, $pw_db); } - // Throws E_NOTICE as salt is not specified. - return crypt($pw); + // PHP8 - we have to specify a salt here.... + $salt = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 2); + + return crypt($pw, $salt); } /**