Open
Description
Description
When creating a UUID instance from a string without dashes (ie: 00000000000000000000000000000000
) it works, but when receiving the same string to validate if it's a valid UUID it fails, which is inconsistent.
The library should not be able to create a UUID for a string that is not valid.
Steps to reproduce
- Create a UUID from a
00000000000000000000000000000000
string. It returns a UUID instance - validate
00000000000000000000000000000000
using the isValid function. It returns false.
Expected behavior
The library should not be able to create a UUID for a string that is not valid.
Screenshots or output
Input and output from Laravel tinker:
> \Ramsey\Uuid\Uuid::fromString('00000000000000000000000000000000')
= Ramsey\Uuid\Rfc4122\NilUuid {#5021
uuid: "00000000-0000-0000-0000-000000000000",
}
> \Ramsey\Uuid\Uuid::isValid('00000000000000000000000000000000')
= false
Environment details
- version of this package: 4.7.5
- PHP version: 8.2.14
- OS: macOS 13.6.1