diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index ece50c4d00f..94efaf2864a 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -210,7 +210,7 @@ function dolDecrypt($chain, $key = '') if (!empty($tmpexplode[1]) && is_string($tmpexplode[0])) { $newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, 0, $tmpexplode[0]); } else { - $newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, ''); + $newchain = openssl_decrypt((string) $tmpexplode[0], $ciphering, $key, 0, ''); } } else { dol_syslog("Error dolDecrypt openssl_decrypt is not available", LOG_ERR); @@ -310,7 +310,7 @@ function dolGetLdapPasswordHash($password, $type = 'md5') $type = 'md5'; } - $salt = substr(sha1(time()), 0, 8); + $salt = substr(sha1((string) time()), 0, 8); if ($type === 'md5') { return '{MD5}' . base64_encode(hash("md5", $password, true)); //For OpenLdap with md5 (based on an unencrypted password in base)