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
1 changed files with 2 additions and 2 deletions

View File

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