Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3902dc5

Browse files
committed
bug #20132 Use "more entropy" option for uniqid() (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #20132). Discussion ---------- Use "more entropy" option for uniqid() | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As you can see in [the source code of the PHP uniqid() function](https://github.com/php/php-src/blob/1c295d4a9ac78fcc2f77d6695987598bb7abcb83/ext/standard/uniqid.c#L68) when you don't pass `true` as the second argument, PHP sleeps the application for 1 microsecond (`usleep(1)`) Symfony uses `true` almost everywhere, but there are still some places (mostly in bundles) where this is not the case. Commits ------- 4403e28 Use "more entropy" option for uniqid()
2 parents 80577f9 + 4403e28 commit 3902dc5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function getProxyCandidates()
8686
$definitions = array(
8787
array(new Definition(__CLASS__), true),
8888
array(new Definition('stdClass'), true),
89-
array(new Definition('foo'.uniqid()), false),
89+
array(new Definition(uniqid('foo', true)), false),
9090
array(new Definition(), false),
9191
);
9292

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
109109
$template .= fread(STDIN, 1024);
110110
}
111111

112-
return $this->display($input, $output, array($this->validate($twig, $template, uniqid('sf_'))));
112+
return $this->display($input, $output, array($this->validate($twig, $template, uniqid('sf_', true))));
113113
}
114114

115115
$filesInfo = $this->getFilesInfo($twig, $filenames);

0 commit comments

Comments
 (0)