From: Tim Düsterhus Date: Fri, 6 Nov 2020 08:57:13 +0000 (+0100) Subject: Replace use MathUtil::getRandomValue() by random_int() X-Git-Tag: 5.4.0_Alpha_1~632 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fb6cd658d6cd5b255fe40155afce1b1a81f3c648;p=GitHub%2FWoltLab%2FWCF.git Replace use MathUtil::getRandomValue() by random_int() --- diff --git a/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php index 633fe5d1ea..d5a3822488 100644 --- a/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/TestableUserNotificationEventHandler.class.php @@ -16,7 +16,6 @@ use wcf\system\language\LanguageFactory; use wcf\system\user\notification\event\ITestableUserNotificationEvent; use wcf\system\SingletonFactory; use wcf\system\WCF; -use wcf\util\MathUtil; use wcf\util\PasswordUtil; use wcf\util\StringUtil; @@ -78,7 +77,7 @@ class TestableUserNotificationEventHandler extends SingletonFactory { 'email' => $username . '@example.com', 'languageID' => $languages[array_rand($languages)]->languageID, 'password' => PasswordUtil::getRandomPassword(), - 'registrationDate' => TIME_NOW - 24 * 3600 * MathUtil::getRandomValue(10, 1000), + 'registrationDate' => TIME_NOW - 24 * 3600 * random_int(10, 1000), 'username' => $username ] ]))->executeAction()['returnValues']; diff --git a/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php b/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php index f0ab7f8052..0489122143 100644 --- a/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php +++ b/wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php @@ -95,7 +95,7 @@ final class UserRegistrationUtil { * @return integer */ public static function getActivationCode($length = 9) { - return MathUtil::getRandomValue(pow(10, $length - 1), pow(10, $length) - 1); + return random_int(pow(10, $length - 1), pow(10, $length) - 1); } /**