diff --git a/src/Symfony/Component/Console/Question/ConfirmationQuestion.php b/src/Symfony/Component/Console/Question/ConfirmationQuestion.php index 0774599fe5..eaea45e770 100644 --- a/src/Symfony/Component/Console/Question/ConfirmationQuestion.php +++ b/src/Symfony/Component/Console/Question/ConfirmationQuestion.php @@ -44,13 +44,14 @@ class ConfirmationQuestion extends Question private function getDefaultNormalizer() { $default = $this->getDefault(); + $regex = $this->trueAnswerRegex; - return function ($answer) use ($default) { + return function ($answer) use ($default, $regex) { if (is_bool($answer)) { return $answer; } - $answerIsTrue = (bool) preg_match($this->trueAnswerRegex, $answer); + $answerIsTrue = (bool) preg_match($regex, $answer); if (false === $default) { return $answer && $answerIsTrue; }