Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.6.0
-
Fix Version/s: 1.7.0
-
Component/s: Zend_Captcha
-
Labels:None
Description
I have captcha form element:
$captcha = new Zend_Form_Element_Captcha('captcha', array( 'label' => "Please verify you're a human", 'captcha' => array( 'captcha' => 'Figlet', 'wordLen' => 6, 'timeout' => 300, ),));
When not fill the edit box, and submit form, I get "Captcha value is wrong" message, ok.
But if I now resend this form by pressing F5, or Ctrl+R, form is validated successfully with empty captcha text box !!!!
Here a test form and controller:
CaptchaTestController.php
class CaptchaForm extends Zend_Form { public function init() { $captcha = new Zend_Form_Element_Captcha('captcha', array( 'label' => "Please verify you're a human", 'captcha' => array( 'captcha' => 'Figlet', 'wordLen' => 6, 'timeout' => 300, ),)); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($captcha, $submit)); } } class CaptchaTestController extends Zend_Controller_Action { function indexAction() { $form = new CaptchaForm(array( 'action' => $this->view->url(array('controller' => 'captchatest')), 'method' => 'post')); $this->view->form = $form; if($this->_request->getParam('submit')) { if ($form->isValid($this->_request->getParams())) { echo "valid form"; } else { echo "invalid form"; } } } }
upped to "Blocker" because this effectively renders Zend_Captcha_Figlet useless