Aleksander Machniak
2015-09-10 e85bbc9e9c577efd4437a032463d4fd79da932b5
random_bytes() can throw an exception in some cases, since PHP 7.0.0rc3
1 files modified
4 ■■■■ changed files
program/lib/Roundcube/rcube_utils.php 4 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_utils.php
@@ -1101,8 +1101,12 @@
    {
        // Use PHP7 true random generator
        if (function_exists('random_bytes')) {
            // random_bytes() can throw an exception in some cases
            try {
            $random = @random_bytes($length);
        }
            catch (Exception $e) {}
        }
        if (!$random) {
            $random = openssl_random_pseudo_bytes($length);