From b2b9b591cef1dd71efa4ba81c2e88cc7c001b307 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 18 Sep 2015 14:17:07 -0400
Subject: [PATCH] Fix handling random_bytes() errors in PHP 7.0.0RC3
---
program/lib/Roundcube/rcube_utils.php | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/program/lib/Roundcube/rcube_utils.php b/program/lib/Roundcube/rcube_utils.php
index 353347b..103a374 100644
--- a/program/lib/Roundcube/rcube_utils.php
+++ b/program/lib/Roundcube/rcube_utils.php
@@ -1101,11 +1101,11 @@
{
// Use PHP7 true random generator
if (function_exists('random_bytes')) {
- // random_bytes() can throw an exception in some cases
+ // random_bytes() can throw an Error/TypeError/Exception in some cases
try {
- $random = @random_bytes($length);
+ $random = random_bytes($length);
}
- catch (Exception $e) {}
+ catch (Throwable $e) {}
}
if (!$random) {
--
Gitblit v1.9.1