diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 7ce7235e0d..a893489c99 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -753,7 +753,7 @@ class baseHelper */ public static function restartSession($sessionID = '') { - if(empty($sessionID)) $sessionID = sha1(random_int(0, mt_getrandmax())); + if(empty($sessionID)) $sessionID = sha1((string)mt_rand(0, mt_getrandmax())); session_write_close(); session_id($sessionID); diff --git a/framework/base/router.class.php b/framework/base/router.class.php index ad27473bbe..cde610f2e0 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2789,7 +2789,7 @@ class baseRouter $view->URAndSR = zget($this->config->custom, 'URAndSR', '0'); $view->maxUploadSize = strtoupper(ini_get('upload_max_filesize')); - $this->session->set('random', random_int(0, 10000)); + $this->session->set('random', mt_rand(0, 10000)); $view->sessionName = session_name(); $view->sessionID = session_id(); $view->random = $this->session->random; @@ -3036,7 +3036,7 @@ class baseRouter * 删除设定时间之前的日志。 * Delete the log before the set time. **/ - if(random_int(0, 10) == 1) + if(mt_rand(0, 10) == 1) { $logDays = $this->config->framework->logDays ?? 14; $dayTime = time() - $logDays * 24 * 3600;