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 f2c9e66

Browse filesBrowse files
committed
Allowing empty secrets to be set
1 parent cc24b55 commit f2c9e66
Copy full SHA for f2c9e66

File tree

1 file changed

+5
-6
lines changed
Filter options

1 file changed

+5
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Command/SecretsSetCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/SecretsSetCommand.php
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9696
$value = strtr(substr(base64_encode(random_bytes($random)), 0, $random), '+/', '-_');
9797
} elseif (!$file = $input->getArgument('file')) {
9898
$value = $io->askHidden('Please type the secret value');
99+
100+
if (null === $value) {
101+
$io->warning('No value provided: using empty string');
102+
$value = '';
103+
}
99104
} elseif ('-' === $file) {
100105
$value = file_get_contents('php://stdin');
101106
} elseif (is_file($file) && is_readable($file)) {
@@ -106,12 +111,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
106111
throw new \InvalidArgumentException(sprintf('File is not readable: "%s".', $file));
107112
}
108113

109-
if (null === $value) {
110-
$io->warning('No value provided, aborting.');
111-
112-
return 1;
113-
}
114-
115114
if ($vault->generateKeys()) {
116115
$io->success($vault->getLastMessage());
117116

0 commit comments

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