validation-bugsnag-email
This commit is contained in:
2
vendor/symfony/uid/LICENSE
vendored
2
vendor/symfony/uid/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2020-2022 Fabien Potencier
|
||||
Copyright (c) 2020-2023 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
10
vendor/symfony/uid/Uuid.php
vendored
10
vendor/symfony/uid/Uuid.php
vendored
@@ -56,7 +56,7 @@ class Uuid extends AbstractUid
|
||||
$uuid = substr_replace($uuid, '-', 18, 0);
|
||||
$uuid = substr_replace($uuid, '-', 23, 0);
|
||||
} elseif (26 === \strlen($uuid) && Ulid::isValid($uuid)) {
|
||||
$ulid = new Ulid('00000000000000000000000000');
|
||||
$ulid = new NilUlid();
|
||||
$ulid->uid = strtoupper($uuid);
|
||||
$uuid = $ulid->toRfc4122();
|
||||
}
|
||||
@@ -132,6 +132,14 @@ class Uuid extends AbstractUid
|
||||
|
||||
public static function isValid(string $uuid): bool
|
||||
{
|
||||
if (self::NIL === $uuid && \in_array(static::class, [__CLASS__, NilUuid::class], true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (self::MAX === strtr($uuid, 'F', 'f') && \in_array(static::class, [__CLASS__, MaxUuid::class], true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!preg_match('{^[0-9a-f]{8}(?:-[0-9a-f]{4}){2}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}Di', $uuid)) {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user