From 218b92926b7f420e6dbd4d112bce8dd6dd16b36f Mon Sep 17 00:00:00 2001 From: Razvan Zaharia <110657736+dzaharia-godaddy@users.noreply.github.com> Date: Fri, 6 Jan 2023 12:46:13 +0200 Subject: [PATCH] Remove whitespaces between elements --- src/XMLSecurityDSig.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/XMLSecurityDSig.php b/src/XMLSecurityDSig.php index 16713ab..5f9aa5b 100644 --- a/src/XMLSecurityDSig.php +++ b/src/XMLSecurityDSig.php @@ -853,6 +853,7 @@ public function sign($objKey, $appendToNode = null) $sMethod = $nodeset->item(0); $sMethod->setAttribute('Algorithm', $objKey->type); $data = $this->canonicalizeData($sInfo, $this->canonicalMethod); + $data = preg_replace("/>\s+<", $data); // remove whitespaces between elements $sigValue = base64_encode($this->signData($objKey, $data)); $sigValueNode = $this->createNewSignNode('SignatureValue', $sigValue); if ($infoSibling = $sInfo->nextSibling) {