8000 Added some validation · symfony/symfony@86ead54 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86ead54

Browse files
committed
Added some validation
1 parent c85247b commit 86ead54

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Console/Question/ConfirmationQuestion.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public function __construct($question, $default = true, $trueAnswer = 'y')
2525
parent::__construct($question, (bool) $default);
2626

2727
$this->setNormalizer($this->getDefaultNormalizer());
28+
29+
if (1 === strlen($trueAnswer)) {
30+
throw new \InvalidArgumentException(sprintf('True answer can only be one character long, "%s" given.', $trueAnswer));
31+
}
2832
$this->trueAnswer = $trueAnswer;
2933
}
3034

0 commit comments

Comments
 (0)
0