The validation pattern UUID module provides needs a little refinement. The current pattern simply checks for hexidecimal numbers, lowercased, in the pattern 8-4-4-4-12. The accepted patterns are a little more nuanced than that.
From http://en.wikipedia.org/wiki/Universally_unique_identifier#Definition:
In the canonical representation, xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, the most significant bits of N indicates the variant (depending on the variant; one, two, or three bits are used). The variant covered by the UUID specification is indicated by the two most significant bits of N being 1 0 (i.e., the hexadecimal N will always be 8, 9, A, or B).
The variant covered by the UUID specification has five versions. For this variant, the four bits of M indicates the UUID version (i.e., the hexadecimal M will be either 1, 2, 3, 4, or 5).
Additionally, UUIDs are case-insensitive, per RFC4122 Section 3:
'The hexadecimal values "a" through "f" are output as lower case characters and are case insensitive on input'.
More detailed info is available from the RFC4122 document (which I know the maintainers are familiar with; not implying anything).
I'll attach a patch with an updated validation pattern.
Comment | File | Size | Author |
---|---|---|---|
#1 | uuid_validation_pattern_fix-2365281-1.patch | 401 bytes | timcosgrove |
Comments
Comment #1
timcosgrove CreditAttribution: timcosgrove commentedPatch attached.
Comment #3
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedNice catch. Thanks for the patch, I've applied it.
Comment #5
sylus CreditAttribution: sylus commentedIt looks like this change results in all of my features needing to be updated.
Brief example:
My real concern is that say a UUID context was leveraged and that is in the feature. Would that original UUID still work?
Comment #6
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commented@sylus please open a new issue for you problem. This patch was applied several weeks ago and included in a release.
A quick check of the posted UUIDs, the first batch validated as generic UUIDs. The second batch are valud v4 UUIDs. I used http://www.uuid-validator.com/ for the validation.