Skip to content

Commit

Permalink
1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Oct 27, 2015
1 parent 6c34cd4 commit 4eca53b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions src/Alo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 4eca53b

Please sign in to comment.