From d9964dcfaabff6a6f77628766b6aa6733504debd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 15:23:33 +0200 Subject: Merging upstream version 0.22.0. Signed-off-by: Daniel Baumann --- vendor/gipfl/systemd/src/NotificationSocket.php | 8 +++++++- vendor/gipfl/web/src/Form.php | 9 +++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'vendor/gipfl') diff --git a/vendor/gipfl/systemd/src/NotificationSocket.php b/vendor/gipfl/systemd/src/NotificationSocket.php index fe4a687..3e28dd6 100644 --- a/vendor/gipfl/systemd/src/NotificationSocket.php +++ b/vendor/gipfl/systemd/src/NotificationSocket.php @@ -11,6 +11,12 @@ class NotificationSocket /** @var resource */ protected $socket; + /** @var string */ + protected $path; + + /** + * @param string $path + */ public function __construct($path) { if (@file_exists($path) && is_writable($path)) { @@ -82,7 +88,7 @@ class NotificationSocket * Connect to the discovered socket * * Will be /run/systemd/notify or similar. No async logic, as this - * shouldn't block. If systemd blocks we're dead anyways, so who cares + * shouldn't block. If systemd blocks we're dead anyway, so who cares */ protected function connect() { 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()); } } -- cgit v1.2.3