From a83c02526a3333ed25c78943e87b1c2c5fd9b3c4 Mon Sep 17 00:00:00 2001 From: Kristen Gilden Date: Sat, 8 Nov 2014 13:57:16 +0200 Subject: [PATCH] [#2] Append file ref digest under ref element They were incorrectly appended to the parent element. --- src/Native/BDocView.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Native/BDocView.php b/src/Native/BDocView.php index 9bca89a..5e6640a 100644 --- a/src/Native/BDocView.php +++ b/src/Native/BDocView.php @@ -123,13 +123,13 @@ private function addFileReference($pathToFile, $pathInEnvelope) // @todo what if none or too many nodes found? $refParent = $this->xpath->query(self::XPATH_FILE_REFS)->item(0); - // @todo algorithm is hard-coded - $this->appendDigest($refParent, 'sha256', hash_file('sha256', $pathToFile, true)); - $ref = $this->dom->createElementNS($refParent->namespaceURI, $refParent->prefix . ':Reference'); $ref->setAttribute('Id', $refId = uniqid()); $ref->setAttribute('URI', $pathInEnvelope); + // @todo algorithm is hard-coded + $this->appendDigest($ref, 'sha256', hash_file('sha256', $pathToFile, true)); + $refParent->appendChild($ref); return $refId;