Your project should not use insecure random number functions

More information: https://insight.symfony.com/what-we-analyse/php.use_insecure_random_function

  1. $code_length = max(4, min(8, $code_length)); // Limiter entre 4 et 8
  2. $verification_code = '';
  3. for ($i = 0; $i < $code_length; $i++) {
  4. $verification_code .= mt_rand(0, 9);
    The function mt_rand() is not cryptographically secure. Use random_int() or random_bytes() instead.
    Time to fix: about 2 hours
    Read doc Permalink Copy Prompt
    Last edited by ClicShopping
  5. }
  6. $expiry_minutes = defined('EMAIL_VERIFICATION_CODE_EXPIRY') ? (int)EMAIL_VERIFICATION_CODE_EXPIRY : 15;
  7. $expiry_time = date('Y-m-d H:i:s', time() + ($expiry_minutes * 60));