One more fix in generate method

This commit is contained in:
Wojciech Sznapka 2011-11-28 20:23:10 +01:00
parent 3ecbec4ae6
commit eb97a9c0af
1 changed files with 4 additions and 2 deletions

View File

@ -149,8 +149,8 @@ class CaptchaType extends AbstractType
private function generateCaptchaValue()
{
if ($this->session->has($this->key)) {
$value = $this->session->get($this->key);
if (!$this->session->has($this->key)) {
$value = '';
$charset = 'abcdefhjkmnprstuvwxyz23456789';
$chars = str_split($charset);
@ -159,6 +159,8 @@ class CaptchaType extends AbstractType
}
$this->session->set($this->key, $value);
} else {
$value = $this->session->get($this->key);
}
return $value;