From f5a156ee06104db03591f1faa68786ca29516809 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Oct 2020 04:17:02 +0100 Subject: [PATCH 1/2] Fix regression --- htdocs/core/class/hookmanager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 45dc98f8301..08c290b5c4c 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -144,7 +144,7 @@ class HookManager */ public function executeHooks($method, $parameters = array(), &$object = '', &$action = '') { - if (! is_array($this->hooks) || empty($this->hooks)) return 0; + if (! is_array($this->hooks) || empty($this->hooks)) return ''; $parameters['context']=join(':', $this->contextarray); //dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); From f51b02026c142f6246a970aa9e4f4eae598c3285 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Oct 2020 04:24:06 +0100 Subject: [PATCH 2/2] Fix regression --- htdocs/core/lib/security2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index aa53a5b71d7..85a297a4bc4 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -527,7 +527,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len } else { - $tmp = random_int(0, $max); + $tmp = mt_rand(0, $max); $generated_password=str_replace($replaceambiguouschars, $numbers[$tmp], $generated_password); } }