-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
QuestionHelper input truncated at 4095 byte #47586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
pbek
added a commit
to pbek/symfony
that referenced
this issue
Sep 15, 2022
#47587 would add a warning in |
pbek
added a commit
to pbek/symfony
that referenced
this issue
Sep 15, 2022
#47588 would add a warning in |
pbek
added a commit
to pbek/symfony
that referenced
this issue
Sep 21, 2022
Co-authored-by: Fabien Potencier <fabien@potencier.org>
pbek
added a commit
to pbek/symfony
that referenced
this issue
Sep 21, 2022
Co-authored-by: Fabien Potencier <fabien@potencier.org>
@pbek Can you do everything in the same PR? That would help with the reviews and ensure that it's all consistent. Thank you. |
fabpot
pushed a commit
to pbek/symfony
that referenced
this issue
Sep 23, 2022
fabpot
added a commit
that referenced
this issue
Sep 23, 2022
…elper (#47586) (pbek) This PR was squashed before being merged into the 6.2 branch. Discussion ---------- Add warning for possibly truncated inputs in QuestionHelper (#47586) | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | Tickets | Fix #47586 | License | MIT Adds a warning for possibly truncated inputs in `QuestionHelper`. Commits ------- 806aa1b Add warning for possibly truncated inputs in QuestionHelper (#47586)
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
6.2
Description
When you ask for input with QuestionHelper the input is truncated at 4096 byte.
The maximum line length in unix terminals is 4096. QuestionHelper additionally only reads the first 4096 byte of the input in:
symfony/src/Symfony/Component/Console/Helper/QuestionHelper.php
Line 431 in 1159d13
How to reproduce
# Enter a very long string here php bin/console secrets:set CERT_P12
See:
symfony/src/Symfony/Bundle/FrameworkBundle/Command/SecretsSetCommand.php
Line 99 in 123b165
The content of
$value
is truncated to 4095 byte when you enter a text longer than that.Possible Solution
Maybe a warning should be printed when an input has exactly 4095 characters to alert the user that there is the possibility that something was truncated.
Additional Context
Use case:
We use the Symfony CLI to set secrets (SecretsSetCommand,
secret:set
). We have very long strings, like base64 encoded certificates in our secrets.The text was updated successfully, but these errors were encountered: