Skip to content
Snippets Groups Projects
Commit e6101bb6 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

make MD5 crypt without salts always use PHP implementation

crypt seems to behave different on different systems when the salt
is empty.
parent 4e7a6f51
No related branches found
No related tags found
No related merge requests found
......@@ -132,7 +132,7 @@ class PassHash {
public function hash_smd5($clear, $salt = null) {
$this->init_salt($salt, 8);
if(defined('CRYPT_MD5') && CRYPT_MD5) {
if(defined('CRYPT_MD5') && CRYPT_MD5 && $salt !== '') {
return crypt($clear, '$1$'.$salt.'$');
} else {
// Fall back to PHP-only implementation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment