From fa9e1f4f5062a8012acbe8f4880ef4b78df15c0f Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Tue, 13 Apr 2010 12:41:14 +0000 Subject: [PATCH] - suppress possible openbase_dir errors git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@103 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Crypt/Random.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index 72df27c4..f0a9814a 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -35,7 +35,7 @@ * @author Jim Wigginton * @copyright MMVII Jim Wigginton * @license http://www.gnu.org/licenses/lgpl.txt - * @version $Id: Random.php,v 1.7 2010-04-07 03:50:54 terrafrost Exp $ + * @version $Id: Random.php,v 1.8 2010-04-13 12:41:14 terrafrost Exp $ * @link http://phpseclib.sourceforge.net */ @@ -61,7 +61,9 @@ function crypt_random($min = 0, $max = 0x7FFFFFFF) } // see http://en.wikipedia.org/wiki//dev/random - if (file_exists('/dev/urandom')) { + // if open_basedir is enabled file_exists() will ouput an "open_basedir restriction in effect" warning, + // so we suppress it. + if (@file_exists('/dev/urandom')) { static $fp; if (!$fp) { $fp = fopen('/dev/urandom', 'rb');