From 96a97bf9cb2493f6d43c5513bd0ce0090eb698ee Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Tue, 3 Jun 2025 21:55:30 +0100 Subject: Fix: #5151 - use UUIDv7 instead of UUIDv4 --- app/Factories/IdFactory.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Factories') 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 ''; } } -- cgit v1.3