From eb97a9c0af10d13165fc71f9a7d817bbba5540f8 Mon Sep 17 00:00:00 2001 From: Wojciech Sznapka Date: Mon, 28 Nov 2011 20:23:10 +0100 Subject: [PATCH] One more fix in generate method --- Type/CaptchaType.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Type/CaptchaType.php b/Type/CaptchaType.php index bf24419..0bea461 100755 --- a/Type/CaptchaType.php +++ b/Type/CaptchaType.php @@ -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;