[ticket/12684] Allowed to use $this in enclosure

PHPBB3-12684
This commit is contained in:
Matt Friedman 2016-02-29 21:04:16 -08:00
parent 0ca4484525
commit b17f9fc81c

View file

@ -140,14 +140,13 @@ class add extends \phpbb\console\command\command
if (!$data['new_password'])
{
$self = $this;
$question = new Question($this->ask_user('PASSWORD'));
$question->setValidator(function ($value) use ($self, $helper, $input, $output) {
$question = new Question($self->ask_user('CONFIRM_PASSWORD'));
$question->setValidator(function ($value) use ($helper, $input, $output) {
$question = new Question($this->ask_user('CONFIRM_PASSWORD'));
$question->setHidden(true);
if ($helper->ask($input, $output, $question) != $value)
{
throw new runtime_exception($self->language->lang('NEW_PASSWORD_ERROR'));
throw new runtime_exception($this->language->lang('NEW_PASSWORD_ERROR'));
}
return $value;
});