From 6eb35eb42c6833d58f8aae41ece77e0541bf7e23 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 14 Feb 2016 11:23:53 -0600 Subject: [PATCH] Random: a few more tweaks --- phpseclib/Crypt/Random.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index 46a441ec..2a5b8d94 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -148,10 +148,10 @@ if (!function_exists('crypt_random_string')) { session_start(); $v = $seed = $_SESSION['seed'] = pack('H*', sha1( - phpseclib_safe_serialize($_SERVER) . - phpseclib_safe_serialize($_POST) . - phpseclib_safe_serialize($_GET) . - phpseclib_safe_serialize($_COOKIE) . + (isset($_SERVER) ? phpseclib_safe_serialize($_SERVER) : '') . + (isset($_POST) ? phpseclib_safe_serialize($_POST) : '') . + (isset($_GET) ? phpseclib_safe_serialize($_GET) : '') . + (isset($_COOKIE) ? phpseclib_safe_serialize($_COOKIE) : '') . phpseclib_safe_serialize($GLOBALS) . phpseclib_safe_serialize($_SESSION) . phpseclib_safe_serialize($_OLD_SESSION)