[Validation] Remove session value even if the posted code is valid

This commit is contained in:
Gregwar 2011-12-02 18:23:08 +01:00
parent 5084b61fd9
commit df7c959f54
1 changed files with 2 additions and 2 deletions

View File

@ -38,9 +38,9 @@ class CaptchaValidator implements FormValidatorInterface
if (!($code && $excepted_code && is_string($code) && is_string($excepted_code) if (!($code && $excepted_code && is_string($code) && is_string($excepted_code)
&& $this->niceize($code) == $this->niceize($excepted_code))) { && $this->niceize($code) == $this->niceize($excepted_code))) {
$form->addError(new FormError('Bad code value')); $form->addError(new FormError('Bad code value'));
} else {
$this->session->remove($this->key);
} }
$this->session->remove($this->key);
} }
/** /**