diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2025-06-03 21:55:30 +0100 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2025-06-03 21:55:30 +0100 |
| commit | 96a97bf9cb2493f6d43c5513bd0ce0090eb698ee (patch) | |
| tree | a557ba618a58c8766bb0e754db50b7593e694d6c /app | |
| parent | 2c1574cd8f380791f5663866523e18fff13ec080 (diff) | |
| download | webtrees-96a97bf9cb2493f6d43c5513bd0ce0090eb698ee.tar.gz webtrees-96a97bf9cb2493f6d43c5513bd0ce0090eb698ee.tar.bz2 webtrees-96a97bf9cb2493f6d43c5513bd0ce0090eb698ee.zip | |
Fix: #5151 - use UUIDv7 instead of UUIDv4
Diffstat (limited to 'app')
| -rw-r--r-- | app/Factories/IdFactory.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/Factories/IdFactory.php b/app/Factories/IdFactory.php index 74ab98efcd..3b15a32700 100644 --- a/app/Factories/IdFactory.php +++ b/app/Factories/IdFactory.php @@ -20,8 +20,8 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Factories; use Fisharebest\Webtrees\Contracts\IdFactoryInterface; -use Ramsey\Uuid\Exception\RandomSourceException; use Ramsey\Uuid\Uuid; +use Throwable; use function hexdec; use function sprintf; @@ -39,9 +39,9 @@ class IdFactory implements IdFactoryInterface public function uuid(): string { try { - return strtolower(Uuid::uuid4()->toString()); - } catch (RandomSourceException) { - // uuid4() can fail if there is insufficient entropy in the system. + return strtolower(Uuid::uuid7()->toString()); + } catch (Throwable) { + // uuid7() can fail for various reasons. return ''; } } |
