From 3ae38fe687fa478f4c4228fbf70308eccc9c64d9 Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Wed, 5 Dec 2018 23:50:02 +0100 Subject: [PATCH] fix: Applying the same parameter as for IDs in created_by_ref UUIDs --- stix2/properties.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stix2/properties.py b/stix2/properties.py index baf9cf3..e323403 100644 --- a/stix2/properties.py +++ b/stix2/properties.py @@ -345,8 +345,12 @@ class ReferenceProperty(Property): if self.type: if not value.startswith(self.type): raise ValueError("must start with '{0}'.".format(self.type)) - if not ID_REGEX.match(value): - raise ValueError(ERROR_INVALID_ID) + if hasattr(self, 'interoperability') and self.interoperability: + if not ID_REGEX_interoperability.match(value): + raise ValueError(ERROR_INVALID_ID) + else: + if not ID_REGEX.match(value): + raise ValueError(ERROR_INVALID_ID) return value