Commit 7cd54e6b authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Merge branch 'master' into 'Support/2.2.X'

Master

See merge request maarch/archivesPubliques!44
parents 7d9130e2 271a62c9
...@@ -810,15 +810,20 @@ class ArchiveTransfer extends abstractMessage ...@@ -810,15 +810,20 @@ class ArchiveTransfer extends abstractMessage
$content->resId = $resource->resId; $content->resId = $resource->resId;
$binary = $resource->getContents();
if (isset($sedaDocument->integrity)) { if (isset($sedaDocument->integrity)) {
$resource->hash = (string) $sedaDocument->integrity->value; $resource->hash = (string) $sedaDocument->integrity->value;
$resource->hashAlgorithm = substr($sedaDocument->integrity->algorithme, strrpos($sedaDocument->integrity->algorithme, "#")+1); $resource->hashAlgorithm = substr($sedaDocument->integrity->algorithme, strrpos($sedaDocument->integrity->algorithme, "#")+1);
} else {
$resource->hash = hash('SHA256', $binary);
$resource->hashAlgorithm = 'SHA256';
} }
if (isset($sedaDocument->size)) { if (isset($sedaDocument->size)) {
$resource->size = (string) $sedaDocument->size->value; $resource->size = (string) $sedaDocument->size->value;
} else { } else {
$resource->size = strlen($resource->getContents()); $resource->size = strlen($binary);
} }
$archive->digitalResources[] = $resource; $archive->digitalResources[] = $resource;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment