BUGFIX #6287 open_basedir restriction breaks RandomGenerator when trying to read dev/urandom (from r115314)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115315 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-12-22 21:01:27 +00:00
parent b3bb0a721a
commit f238823b27

View File

@ -36,7 +36,7 @@ class RandomGenerator {
}
// Read from the unix random number generator
if(!$isWin && is_readable('/dev/urandom') && ($h = fopen('/dev/urandom', 'rb'))) {
if(!$isWin && !ini_get('open_basedir') && is_readable('/dev/urandom') && ($h = fopen('/dev/urandom', 'rb'))) {
$e = fread($h, 64);
fclose($h);
return $e;