diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:23:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:23:33 +0000 |
commit | d9964dcfaabff6a6f77628766b6aa6733504debd (patch) | |
tree | ddaef95c1421ca7e77b3e2ecb0b4efa550312316 /vendor/gipfl/web/src | |
parent | Releasing progress-linux version 0.20.0-2~progress7.99u1. (diff) | |
download | icingaweb2-module-incubator-d9964dcfaabff6a6f77628766b6aa6733504debd.tar.xz icingaweb2-module-incubator-d9964dcfaabff6a6f77628766b6aa6733504debd.zip |
Merging upstream version 0.22.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gipfl/web/src')
-rw-r--r-- | vendor/gipfl/web/src/Form.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/vendor/gipfl/web/src/Form.php b/vendor/gipfl/web/src/Form.php index e5e52f9..348ec9d 100644 --- a/vendor/gipfl/web/src/Form.php +++ b/vendor/gipfl/web/src/Form.php @@ -201,8 +201,9 @@ class Form extends iplForm protected function addCsrfElement() { - $element = new HiddenElement('__CSRF__', [ + $element = new HiddenElement('__FORM_CSRF', [ 'ignore' => true, + 'required' => true ]); $element->setValidators([ new PhpSessionBasedCsrfTokenValidator() @@ -210,11 +211,7 @@ class Form extends iplForm // prepend / register -> avoid decorator $this->prepend($element); $this->registerElement($element); - if ($this->hasBeenSent()) { - if (! $element->isValid()) { - $element->setValue(PhpSessionBasedCsrfTokenValidator::generateCsrfValue()); - } - } else { + if (! $this->hasBeenSent()) { $element->setValue(PhpSessionBasedCsrfTokenValidator::generateCsrfValue()); } } |