Verified Commit 9fd49e36 authored by Juraj Nemec's avatar Juraj Nemec
Browse files

Issue #3299271 by poker10: [D7 PHP 8.1] strlen(): Passing null to parameter #1...

Issue #3299271 by poker10: [D7 PHP 8.1] strlen(): Passing null to parameter #1 ($string) of type string is deprecated in drupal_random_bytes()
parent 2464f113
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2348,7 +2348,7 @@ function drupal_random_bytes($count) {
    // the microtime() - is prepended rather than appended. This is to avoid
    // directly leaking $random_state via the $output stream, which could
    // allow for trivial prediction of further "random" numbers.
    if (strlen($bytes) < $count) {
    if (strlen((string) $bytes) < $count) {
      // Initialize on the first call. The contents of $_SERVER includes a mix of
      // user-specific and system information that varies a little with each page.
      if (!isset($random_state)) {