Fix rcube_utils::random_bytes() to not throw exception for length=0

pull/6072/head
Thomas Bruederli 7 years ago
parent 392f88afc1
commit 3762dba408

@ -1167,7 +1167,7 @@ class rcube_utils
$random = openssl_random_pseudo_bytes($length);
if ($random === false) {
if ($random === false && $length > 0) {
throw new Exception("Failed to get random bytes");
}

Loading…
Cancel
Save