Skip to content

Commit 1275f48

Browse files
committed
Fixed the salt generation algorithm in the password reset function.
1 parent b5f654a commit 1275f48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interface/web/login/password_reset.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@
5454
if($client['client_id'] > 0) {
5555
$new_password = md5 (uniqid (rand()));
5656
$salt="$1$";
57-
for ($n=0;$n<11;$n++) {
58-
$salt.=chr(mt_rand(64,126));
57+
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
58+
for ($n=0;$n<8;$n++) {
59+
//$salt.=chr(mt_rand(64,126));
60+
$salt.=$base64_alphabet[mt_rand(0,63)];
5961
}
6062
$salt.="$";
6163
$new_password_encrypted = crypt($new_password,$salt);

0 commit comments

Comments
 (0)