Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5f364af

Browse filesBrowse files
committed
bug #36121 [VarDumper] fix side-effect by not using mt_rand() (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] fix side-effect by not using mt_rand() | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Reported by @bobthecow on Twitter: using `mt_rand()` breaks inspecting seeded calls to `mt_rand()`. Should be replaced by a call to `md5(random_bytes(6))` on 4.4. Commits ------- 8c85f91 [VarDumper] fix side-effect by not using mt_rand()
2 parents 2baa812 + 8c85f91 commit 5f364af
Copy full SHA for 5f364af

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/VarDumper/Cloner/VarCloner.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Cloner/VarCloner.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ protected function doClone($var)
4848
// or null if the original value is used directly
4949

5050
if (!self::$hashMask) {
51-
self::$gid = uniqid(mt_rand(), true); // Unique string used to detect the special $GLOBALS variable
5251
self::initHashMask();
52+
self::$gid = md5(dechex(self::$hashMask)); // Unique string used to detect the special $GLOBALS variable
5353
}
5454
$gid = self::$gid;
5555
$hashMask = self::$hashMask;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.