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

Skip to content

Commit 3eacfda

Browse files
committed
feature #47588 Add warning for possibly truncated inputs in QuestionHelper (#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)
2 parents 5205e1f + 806aa1b commit 3eacfda

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Console/Helper/QuestionHelper.php

+5
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,11 @@ private function getHiddenResponse(OutputInterface $output, $inputStream, bool $
430430

431431
$value = fgets($inputStream, 4096);
432432

433+
if (4095 === strlen($value)) {
434+
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
435+
$errOutput->warning('The value was possibly truncated by your shell or terminal emulator');
436+
}
437+
433438
if (self::$stty && Terminal::hasSttyAvailable()) {
434439
shell_exec('stty '.$sttyMode);
435440
}

0 commit comments

Comments
 (0)