fixed PHP 5.3 compat
This commit is contained in:
parent
2570042937
commit
92da9964ad
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user