Skip to content

Commit

Permalink
Revert "Validate version and variant for UUID (#48321)" (#48385)
Browse files Browse the repository at this point in the history
This reverts commit 1591fed.
  • Loading branch information
taylorotwell authored Sep 13, 2023
1 parent 737cdec commit f5c86ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions tests/Support/SupportStrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
}

Expand Down

0 comments on commit f5c86ee

Please sign in to comment.