Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
Conflicts: htdocs/core/class/hookmanager.class.php htdocs/core/lib/security2.lib.php
This commit is contained in:
commit
1a02504792
@ -516,14 +516,11 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len
|
|||||||
{
|
{
|
||||||
$numbers = "ABCDEF";
|
$numbers = "ABCDEF";
|
||||||
$max = strlen($numbers) - 1;
|
$max = strlen($numbers) - 1;
|
||||||
if (function_exists('random_int')) // Cryptographic random
|
if (function_exists('random_int')) { // Cryptographic random
|
||||||
{
|
|
||||||
$tmp = random_int(0, $max);
|
$tmp = random_int(0, $max);
|
||||||
$generated_password = str_replace($replaceambiguouschars, $numbers[$tmp], $generated_password);
|
$generated_password = str_replace($replaceambiguouschars, $numbers[$tmp], $generated_password);
|
||||||
}
|
} else {
|
||||||
else
|
$tmp = mt_rand(0, $max);
|
||||||
{
|
|
||||||
$tmp = random_int(0, $max);
|
|
||||||
$generated_password = str_replace($replaceambiguouschars, $numbers[$tmp], $generated_password);
|
$generated_password = str_replace($replaceambiguouschars, $numbers[$tmp], $generated_password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user