Index: library/Zend/Form/Element/Captcha.php =================================================================== --- library/Zend/Form/Element/Captcha.php (revision 24270) +++ library/Zend/Form/Element/Captcha.php (working copy) @@ -178,18 +178,25 @@ $captcha = $this->getCaptcha(); $captcha->setName($this->getFullyQualifiedName()); - $decorators = $this->getDecorators(); + if (!$this->loadDefaultDecoratorsIsDisabled()) { + $decorators = $this->getDecorators(); + $decorator = $captcha->getDecorator(); + $key = get_class($this->_getDecorator($decorator, null)); - $decorator = $captcha->getDecorator(); - if (!empty($decorator)) { - array_unshift($decorators, $decorator); - } else { + if (!empty($decorator) && !array_key_exists($key, $decorators)) { + array_unshift($decorators, $decorator); + } + $decorator = array('Captcha', array('captcha' => $captcha)); - array_unshift($decorators, $decorator); + $key = get_class($this->_getDecorator($decorator[0], $decorator[1])); + + if ($captcha instanceof Zend_Captcha_Word && !array_key_exists($key, $decorators)) { + array_unshift($decorators, $decorator); + } + + $this->setDecorators($decorators); } - $this->setDecorators($decorators); - $this->setValue($this->getCaptcha()->generate()); return parent::render($view);