fix: wrong attribute value hash computed inside checkForDuplicateObjects function

Signed-off-by: Sebastiano Mariani <smariani@vmware.com>
pull/7551/head
Sebastiano Mariani 2021-07-06 11:44:26 -07:00
parent 0c25b72072
commit c51ef9da8e
1 changed files with 5 additions and 1 deletions

View File

@ -365,9 +365,13 @@ class MispObject extends AppModel
$attribute['value'] = $attribute['value'] . '|' . md5(base64_decode($attribute['data']));
}
}
$attributeValueAfterModification = $this->Attribute->modifyBeforeValidation($attribute['type'], $attribute['value']);
$attributeValueAfterModification = $this->Attribute->runRegexp($attribute['type'], $attributeValueAfterModification);
$newObjectAttributes[] = hash(
'sha256',
$attribute['object_relation'] . $attribute['category'] . $attribute['type'] . $this->Attribute->modifyBeforeValidation($attribute['type'], $attribute['value'])
$attribute['object_relation'] . $attribute['category'] . $attribute['type'] . $attributeValueAfterModification
);
}
$newObjectAttributeCount = count($newObjectAttributes);