mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-15 22:11:36 +01:00
Replace function rand with mt_rand (prepare php 8)
This commit is contained in:
@@ -5393,7 +5393,7 @@ function dol_set_focus($selector)
|
||||
function dol_getmypid()
|
||||
{
|
||||
if (! function_exists('getmypid')) {
|
||||
return rand(1,32768);
|
||||
return mt_rand(1,32768);
|
||||
} else {
|
||||
return getmypid();
|
||||
}
|
||||
|
||||
@@ -134,19 +134,19 @@ class modGeneratePassPerso extends ModeleGenPassword
|
||||
{
|
||||
$pass = "";
|
||||
for($i=0; $i<$this->NbMaj; $i++){ // Y
|
||||
$pass .= $this->Maj[rand(0,strlen($this->Maj) - 1)];
|
||||
$pass .= $this->Maj[mt_rand(0,strlen($this->Maj) - 1)];
|
||||
}
|
||||
|
||||
for($i=0; $i<$this->NbNum; $i++){ // X
|
||||
$pass .= $this->Nb[rand(0,strlen($this->Nb) - 1)];
|
||||
$pass .= $this->Nb[mt_rand(0,strlen($this->Nb) - 1)];
|
||||
}
|
||||
|
||||
for($i=0; $i<$this->NbSpe; $i++){ // @
|
||||
$pass .= $this->Spe[rand(0,strlen($this->Spe) - 1)];
|
||||
$pass .= $this->Spe[mt_rand(0,strlen($this->Spe) - 1)];
|
||||
}
|
||||
|
||||
for($i=strlen($pass);$i<$this->length2; $i++){ // y
|
||||
$pass .= $this->All[rand(0,strlen($this->All) -1)];
|
||||
$pass .= $this->All[mt_rand(0,strlen($this->All) -1)];
|
||||
}
|
||||
|
||||
$pass = str_shuffle($pass);
|
||||
|
||||
Reference in New Issue
Block a user