Form: Create CSRFTokens in way that ensures id uniqueness
This commit is contained in:
parent
974bff9227
commit
7f0ddd931c
|
@ -1085,7 +1085,7 @@ class Form extends Zend_Form
|
|||
return $this;
|
||||
}
|
||||
if ($this->getElement($this->tokenElementName) === null) {
|
||||
$this->addElement(new CsrfCounterMeasure($this->tokenElementName));
|
||||
$this->addElement('CsrfCounterMeasure', $this->tokenElementName);
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
|
|
|
@ -40,7 +40,7 @@ class CsrfCounterMeasure extends FormElement
|
|||
*/
|
||||
public function init()
|
||||
{
|
||||
$this->addDecorator('ViewHelper');
|
||||
$this->setDecorators(['ViewHelper']);
|
||||
$this->setValue($this->generateCsrfToken());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue