Skip to content

Commit c5b1134

Browse files
Check whether secrets are empty and mark them all as sensitive
1 parent 59e2658 commit c5b1134

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

UriSigner.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Component\HttpFoundation;
1313

1414
/**
15-
* Signs URIs.
16-
*
1715
* @author Fabien Potencier <[email protected]>
1816
*/
1917
class UriSigner
@@ -22,11 +20,14 @@ class UriSigner
2220
private string $parameter;
2321

2422
/**
25-
* @param string $secret A secret
2623
* @param string $parameter Query string parameter to use
2724
*/
2825
public function __construct(#[\SensitiveParameter] string $secret, string $parameter = '_hash')
2926
{
27+
if (!$secret) {
28+
throw new \InvalidArgumentException('A non-empty secret is required.');
29+
}
30+
3031
$this->secret = $secret;
3132
$this->parameter = $parameter;
3233
}

0 commit comments

Comments
 (0)