diff options
| author | Benjamin Southall <applemansigloo@gmail.com> | 2017-05-04 10:20:16 +0900 |
|---|---|---|
| committer | Benjamin Southall <applemansigloo@gmail.com> | 2017-05-04 10:20:16 +0900 |
| commit | 40094c9e1a9f36680b60796fa59eaf7ca27ebb10 (patch) | |
| tree | f9daf05cfb6cb1e34eaa4f8750069abb1ad1ad5c | |
| parent | 9b95be050a4a87fc364bd48f745b941895452d89 (diff) | |
| parent | 7c8f857c3b771be84e9537cca93da4546c9c4102 (diff) | |
Merge branch 'master' of https://github.com/lainchan/lainchan
| -rw-r--r-- | inc/mod/auth.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/mod/auth.php b/inc/mod/auth.php index 42f34196..2a264f18 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -70,7 +70,11 @@ function test_password($password, $salt, $test) { function generate_salt() { // 128 bits of entropy - return strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.'); + if (function_exists('random_bytes')) { + return strtr(base64_encode(random_bytes(16)), '+', '.'); + } else { + return strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.'); + } } function login($username, $password) { |
