From ff6f14f73b43430b8f0d29e626faa3d3f68e1bd3 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 30 Jul 2024 22:37:41 +0200 Subject: [PATCH] Disable formatting on signed elements --- src/XML/SignedElementTrait.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/XML/SignedElementTrait.php b/src/XML/SignedElementTrait.php index d9fc68dc..7572399e 100644 --- a/src/XML/SignedElementTrait.php +++ b/src/XML/SignedElementTrait.php @@ -74,6 +74,11 @@ public function getSignature(): ?Signature */ protected function setSignature(Signature $signature): void { + /** + * By disabling formatting on signed objects, we prevent issues with invalid signatures later on + * at the cost of some whitespace taking up useless bytes in the outputted document. + */ + $this->formatOutput = false; $this->signature = $signature; }