From f5c86eef5475693683c61facb3f1d6a58d04f344 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 13 Sep 2023 10:51:14 -0400 Subject: [PATCH] Revert "Validate version and variant for UUID (#48321)" (#48385) This reverts commit 1591fed925408fd03c9f2cd5230f333e34594c83. --- src/Illuminate/Support/Str.php | 6 +----- tests/Support/SupportStrTest.php | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index ae0849434b14..62c7ccda605f 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -520,11 +520,7 @@ public static function isUuid($value) return false; } - if ($value === '00000000-0000-0000-0000-000000000000') { - return true; - } - - return preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iD', $value) > 0; + return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0; } /** diff --git a/tests/Support/SupportStrTest.php b/tests/Support/SupportStrTest.php index c455c64d65be..8a2e7979f70c 100755 --- a/tests/Support/SupportStrTest.php +++ b/tests/Support/SupportStrTest.php @@ -965,8 +965,6 @@ public static function invalidUuidList() ['af6f8cb-c57d-11e1-9b21-0800200c9a66'], ['af6f8cb0c57d11e19b210800200c9a66'], ['ff6f8cb0-c57da-51e1-9b21-0800200c9a66'], - ['ff6f8cb0-c57d-11e1-cb21-0800200c9a66'], // Invalid variant - ['ff6f8cb0-c57d-61e1-9b21-0800200c9a66'], // Invalid version ]; }