Skip to content

Commit 1859330

Browse files
authored
Merge pull request #187 from akrabat/increase-uniqid-entropy
Increase uniqid entropy
2 parents 56a0cfb + 163f301 commit 1859330

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ See https://github.com/slimphp/Slim-Csrf/releases for a full list
1010
underscore. This should not affect anyone who uses the relvant methods, but
1111
if you have hard-coded, then they will need to be updated.
1212

13+
- Changed: Increased likelihood that tokens are unique.
14+
1315
## 1.5.0
1416

1517
- Added: Support for PHP 8.2 and 8.3

src/Guard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ protected function createToken(): string
215215
public function generateToken(): array
216216
{
217217
// Generate new CSRF token
218-
$name = uniqid($this->prefix);
218+
$name = uniqid($this->prefix, true);
219219
$value = $this->createToken();
220220
$this->saveTokenToStorage($name, $value);
221221

0 commit comments

Comments
 (0)