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()
|
private function getDefaultNormalizer()
|
||||||
{
|
{
|
||||||
$default = $this->getDefault();
|
$default = $this->getDefault();
|
||||||
|
$regex = $this->trueAnswerRegex;
|
||||||
|
|
||||||
return function ($answer) use ($default) {
|
return function ($answer) use ($default, $regex) {
|
||||||
if (is_bool($answer)) {
|
if (is_bool($answer)) {
|
||||||
return $answer;
|
return $answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
$answerIsTrue = (bool) preg_match($this->trueAnswerRegex, $answer);
|
$answerIsTrue = (bool) preg_match($regex, $answer);
|
||||||
if (false === $default) {
|
if (false === $default) {
|
||||||
return $answer && $answerIsTrue;
|
return $answer && $answerIsTrue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user