Skip to content

Commit c2b0d72

Browse files
committed
minor #57697 use more entropy with uniqid() (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- use more entropy with uniqid() | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT It looked like using `uniqid()` without opting for more entropy slipped in after #20132 and #20137. Commits ------- 770e7fc use more entropy with uniqid()
2 parents b83bacb + 770e7fc commit c2b0d72

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/log_file.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Test DeprecationErrorHandler with log file
33
--FILE--
44
<?php
5-
$filename = tempnam(sys_get_temp_dir(), 'sf-').uniqid();
5+
$filename = tempnam(sys_get_temp_dir(), 'sf-').uniqid('', true);
66
$k = 'SYMFONY_DEPRECATIONS_HELPER';
77
putenv($k.'='.$_SERVER[$k] = $_ENV[$k] = 'logFile='.$filename);
88
putenv('ANSICON');

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AnnotationsCacheWarmerTest extends TestCase
2828

2929
protected function setUp(): void
3030
{
31-
$this->cacheDir = sys_get_temp_dir().'/'.uniqid();
31+
$this->cacheDir = sys_get_temp_dir().'/'.uniqid('', true);
3232
$fs = new Filesystem();
3333
$fs->mkdir($this->cacheDir);
3434
parent::setUp();

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ConfigBuilderCacheWarmerTest extends TestCase
3636

3737
protected function setUp(): void
3838
{
39-
$this->varDir = sys_get_temp_dir().'/'.uniqid();
39+
$this->varDir = sys_get_temp_dir().'/'.uniqid('', true);
4040
$fs = new Filesystem();
4141
$fs->mkdir($this->varDir);
4242
}

src/Symfony/Component/Notifier/Bridge/Iqsms/IqsmsTransport.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function doSend(MessageInterface $message): SentMessage
6464
'phone' => $message->getPhone(),
6565
'text' => $message->getSubject(),
6666
'sender' => $this->from,
67-
'clientId' => uniqid(),
67+
'clientId' => uniqid('', true),
6868
],
6969
],
7070
'login' => $this->login,

src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function setUp(): void
3333
{
3434
parent::setUp();
3535

36-
$this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.uniqid('CompiledUrlMatcher').'.php';
36+
$this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.uniqid('CompiledUrlMatcher', true).'.php';
3737
}
3838

3939
protected function tearDown(): void

src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class ClassMetadataFactoryCompilerTest extends TestCase
2929

3030
protected function setUp(): void
3131
{
32-
$this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_serializer_metadata.'.uniqid('CompiledClassMetadataFactory').'.php';
32+
$this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_serializer_metadata.'.uniqid('CompiledClassMetadataFactory', true).'.php';
3333
}
3434

3535
protected function tearDown(): void

0 commit comments

Comments
 (0)