QuickForm: set csrf value through addHidden

This commit is contained in:
Thomas Gelf 2015-08-02 13:42:00 +02:00
parent 69b394cda5
commit de843b19ed

View File

@ -155,10 +155,10 @@ abstract class QuickForm extends Zend_Form
public function regenerateCsrfToken() public function regenerateCsrfToken()
{ {
if (! $element = $this->getElement(self::CSRF)) { if (! $element = $this->getElement(self::CSRF)) {
$this->addHidden(self::CSRF); $this->addHidden(self::CSRF, CsrfToken::generate());
$element = $this->getElement(self::CSRF); $element = $this->getElement(self::CSRF);
} }
$element->setValue(CsrfToken::generate())->setIgnore(true); $element->setIgnore(true);
return $this; return $this;
} }