Skip to content

Commit f5c86ee

Browse files
authored
Revert "Validate version and variant for UUID (#48321)" (#48385)
This reverts commit 1591fed.
1 parent 737cdec commit f5c86ee

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/Illuminate/Support/Str.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,7 @@ public static function isUuid($value)
520520
return false;
521521
}
522522

523-
if ($value === '00000000-0000-0000-0000-000000000000') {
524-
return true;
525-
}
526-
527-
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;
523+
return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0;
528524
}
529525

530526
/**

tests/Support/SupportStrTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,6 @@ public static function invalidUuidList()
965965
['af6f8cb-c57d-11e1-9b21-0800200c9a66'],
966966
['af6f8cb0c57d11e19b210800200c9a66'],
967967
['ff6f8cb0-c57da-51e1-9b21-0800200c9a66'],
968-
['ff6f8cb0-c57d-11e1-cb21-0800200c9a66'], // Invalid variant
969-
['ff6f8cb0-c57d-61e1-9b21-0800200c9a66'], // Invalid version
970968
];
971969
}
972970

0 commit comments

Comments
 (0)