Fixed PHP warning in Rijndael RNG code when open_basedir restriction in effect
authorDan
Sun, 02 Mar 2008 14:52:08 -0500
changeset 287 3370d63928cf
parent 286 a3ee29133094
child 288 30ef6b618795
Fixed PHP warning in Rijndael RNG code when open_basedir restriction in effect
includes/rijndael.php
--- a/includes/rijndael.php	Thu Feb 28 12:33:25 2008 -0500
+++ b/includes/rijndael.php	Sun Mar 02 14:52:08 2008 -0500
@@ -900,10 +900,10 @@
     {
       $key .= chr(mt_rand(0, 255));
     }
-    if ( file_exists('/dev/urandom') && is_readable('/dev/urandom') )
+    if ( @file_exists('/dev/random') && @is_readable('/dev/random') )
     {
       // Let's use something a little more secure
-      $ur = @fopen('/dev/urandom', 'r');
+      $ur = @fopen('/dev/random', 'r');
       if ( !$ur )
         return $key;
       $ukey = @fread($ur, $len);