Skip to content

Commit

Permalink
[#2] Append file ref digest under ref element
Browse files Browse the repository at this point in the history
They were incorrectly appended to the parent element.
  • Loading branch information
kgilden committed Nov 8, 2014
1 parent 573c971 commit a83c025
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Native/BDocView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a83c025

Please sign in to comment.