diff options
author | Mario <mario@mariovavti.com> | 2022-10-12 08:45:01 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-12 08:45:01 +0000 |
commit | 8bf5c18425cf15327fa11494e6e0d3749f36c6f8 (patch) | |
tree | fc358336312cd23030321a43f276db19cea17621 /vendor/ramsey/uuid/src/Rfc4122/Validator.php | |
parent | c36bb17475b3dd5925cefc32752f1fb8a63df154 (diff) | |
download | volse-hubzilla-8bf5c18425cf15327fa11494e6e0d3749f36c6f8.tar.gz volse-hubzilla-8bf5c18425cf15327fa11494e6e0d3749f36c6f8.tar.bz2 volse-hubzilla-8bf5c18425cf15327fa11494e6e0d3749f36c6f8.zip |
composer update ramsey/uuid
Diffstat (limited to 'vendor/ramsey/uuid/src/Rfc4122/Validator.php')
-rw-r--r-- | vendor/ramsey/uuid/src/Rfc4122/Validator.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/ramsey/uuid/src/Rfc4122/Validator.php b/vendor/ramsey/uuid/src/Rfc4122/Validator.php index ed43c982f..6b1f0de06 100644 --- a/vendor/ramsey/uuid/src/Rfc4122/Validator.php +++ b/vendor/ramsey/uuid/src/Rfc4122/Validator.php @@ -28,7 +28,7 @@ use function str_replace; final class Validator implements ValidatorInterface { private const VALID_PATTERN = '\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-' - . '[1-5]{1}[0-9A-Fa-f]{3}-[ABab89]{1}[0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}\z'; + . '[1-7][0-9A-Fa-f]{3}-[ABab89][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}\z'; /** * @psalm-return non-empty-string @@ -43,7 +43,8 @@ final class Validator implements ValidatorInterface public function validate(string $uuid): bool { $uuid = str_replace(['urn:', 'uuid:', 'URN:', 'UUID:', '{', '}'], '', $uuid); + $uuid = strtolower($uuid); - return $uuid === Uuid::NIL || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); + return $uuid === Uuid::NIL || $uuid === Uuid::MAX || preg_match('/' . self::VALID_PATTERN . '/Dms', $uuid); } } |