From 4eca53bc73145247ce223359a702c673e1e11509 Mon Sep 17 00:00:00 2001 From: Alorel Date: Tue, 27 Oct 2015 17:24:35 +0000 Subject: [PATCH] 1.3.1 --- CHANGELOG.md | 4 ++++ src/Alo.php | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a352477..396f017 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.3.1 # + +Fixed a bug in getUniqid() which tried to use a nonexistent constant + # 1.3 # getUniqid(), asciiRand(), isRegularRequest() added diff --git a/src/Alo.php b/src/Alo.php index 1e0c76e..8d60286 100644 --- a/src/Alo.php +++ b/src/Alo.php @@ -207,13 +207,13 @@ static function asciiRand($length, $subset = self::ASCII_ALL) { * @codeCoverageIgnore */ static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 250, $rawOutput = false) { - $str = mt_rand(PHP_INT_MIN, PHP_INT_MAX) . json_encode([$_COOKIE, - $_REQUEST, - $_FILES, - $_ENV, - $_GET, - $_POST, - $_SERVER]) . uniqid($prefix, true) . + $str = mt_rand(~PHP_INT_MAX, PHP_INT_MAX) . json_encode([$_COOKIE, + $_REQUEST, + $_FILES, + $_ENV, + $_GET, + $_POST, + $_SERVER]) . uniqid($prefix, true) . self::asciiRand($entropy, self::ASCII_ALL); if (function_exists('\openssl_random_pseudo_bytes')) {