Index: tests/Zend/Form/Element/CaptchaTest.php =================================================================== --- tests/Zend/Form/Element/CaptchaTest.php (revision 15725) +++ tests/Zend/Form/Element/CaptchaTest.php (working copy) @@ -153,6 +153,15 @@ $this->assertTrue(array_key_exists('Zend_Form_Decorator_HtmlTag', $decorators), 'Missing HtmlTag decorator' . var_export(array_keys($decorators), 1)); $this->assertTrue(array_key_exists('Zend_Form_Decorator_Label', $decorators), 'Missing Label decorator' . var_export(array_keys($decorators), 1)); } + + /** + * @group ZF-5855 + */ + public function testHelperDoesNotShowUpInAttribs() + { + require_once 'Zend/View.php'; + $this->assertFalse(array_key_exists('helper', $this->element->getAttribs())); + } } class Zend_Form_Element_CaptchaTest_SessionContainer Index: library/Zend/Form/Element/Captcha.php =================================================================== --- library/Zend/Form/Element/Captcha.php (revision 15725) +++ library/Zend/Form/Element/Captcha.php (working copy) @@ -53,6 +53,25 @@ * @var Zend_Captcha_Adapter */ protected $_captcha; + + /** + * Return all attributes + * + * @return array + */ + public function getAttribs() + { + $attribs = get_object_vars($this); + unset($attribs['helper']); + foreach ($attribs as $key => $value) { + if ('_' == substr($key, 0, 1)) { + unset($attribs[$key]); + } + } + + return $attribs; + } + /** * Get captcha adapter