ZF-4039: Zend_Captcha example with bug



The demo code in the page… has a bug that makes it not working. As reported in the Zend_Captcha_Adapter interface, the render method must receive a Zend_View to function. Thus the correct code that allows a figlet to be shown is:

$view = new Zend_View(); $captcha = new Zend_Captcha_Figlet(array( 'name' => 'foo', 'wordLen' => 6, 'timeout' => 300,)); $id = $captcha->generate(); echo $captcha->render($view);

Instead of the current

$captcha = new Zend_Captcha_Figlet(array( 'name' => 'foo', 'wordLen' => 6, 'timeout' => 300,)); $id = $captcha->generate(); echo $captcha->render();

Without the prior $view definition and passing it to the renderer, a user will see a blank page (ad wonder what has gone wrong !). I've put in Major priority because even if is a trivial error, block programmers that likes to use demo code as a starting point.

BTW, in the components list there is not yet Zend_Captcha, so I've put it under unknown.

I hope that you are going to correct the doc ASAP.

Best Regards

G. Pennella


It has been already reported.

Assign the right component

r11125 fixes the problem