From aacccee24ef59daa8e9488ffad8b4485997f5b98 Mon Sep 17 00:00:00 2001 From: Karol Stelmaczonek Date: Thu, 11 Apr 2024 16:09:25 +0200 Subject: [PATCH] feat: add sorting and to lower for checksum --- models/classes/metadata/ChecksumGenerator.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/models/classes/metadata/ChecksumGenerator.php b/models/classes/metadata/ChecksumGenerator.php index 8ea6b8976..2c45e0c45 100644 --- a/models/classes/metadata/ChecksumGenerator.php +++ b/models/classes/metadata/ChecksumGenerator.php @@ -22,6 +22,7 @@ namespace oat\taoQtiTest\models\classes\metadata; +use common_Logger; use core_kernel_classes_Property as Property; use oat\generis\model\data\Ontology; @@ -45,11 +46,11 @@ public function getRangeChecksum(Property $property): string if (empty($listValues)) { return ''; } - + asort($listValues); foreach ($listValues as $value) { - $checksum .= $this->ontology->getResource($value['id'])->getLabel(); + $checksum .= strtolower($this->ontology->getResource($value['id'])->getLabel()); } - - return sha1($checksum); + common_Logger::e(sprintf('ChecksumGenerator value before sha1 : "%s"', $checksum)); + return sha1(trim($checksum)); } }