suppress warning if /dev/urandom is not readable (bug #997)

This commit is contained in:
Bjoern Schiessle 2012-06-14 12:01:16 +02:00
parent e154806838
commit 6c7e10245c
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class PasswordHash {
function get_random_bytes($count) function get_random_bytes($count)
{ {
$output = ''; $output = '';
if (is_readable('/dev/urandom') && if (@is_readable('/dev/urandom') &&
($fh = @fopen('/dev/urandom', 'rb'))) { ($fh = @fopen('/dev/urandom', 'rb'))) {
$output = fread($fh, $count); $output = fread($fh, $count);
fclose($fh); fclose($fh);