Skip to content

Commit beff62f

Browse files
minor #57746 do not use uniqid() for generating dev tool tokens (xabbuh)
This PR was merged into the 7.2 branch. Discussion ---------- do not use `uniqid()` for generating dev tool tokens | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | part of #57588 | License | MIT Commits ------- 5ad7ab9fab do not use uniqid() for generating dev tool tokens
2 parents 4495b7f + 0931874 commit beff62f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EventListener/ConsoleProfilerListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function initialize(ConsoleCommandEvent $event): void
7777
return;
7878
}
7979

80-
$request->attributes->set('_stopwatch_token', substr(hash('xxh128', uniqid(mt_rand(), true)), 0, 6));
80+
$request->attributes->set('_stopwatch_token', bin2hex(random_bytes(3)));
8181
$this->stopwatch->openSection();
8282
}
8383

0 commit comments

Comments
 (0)