urandom is not available on Windows

This commit is contained in:
Maxime 2014-03-08 19:00:12 +01:00
parent 66fbcc4ea2
commit ddd856121d
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ abstract class Base
// Generate a random token from /dev/urandom or with uniqid()
public static function generateToken()
{
if (ini_get('open_basedir') === '') {
if (ini_get('open_basedir') === '' and strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
$token = file_get_contents('/dev/urandom', false, null, 0, 30);
}
else {