From f95f69e52d4f728ed7b55b4542625779bcb05400 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 1 Sep 2023 12:19:17 +0200 Subject: [PATCH] wait #6235 @0.25 --- app/Fluidbook/Link/LinksData.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Fluidbook/Link/LinksData.php b/app/Fluidbook/Link/LinksData.php index aa869cc04..d0fcf69fe 100644 --- a/app/Fluidbook/Link/LinksData.php +++ b/app/Fluidbook/Link/LinksData.php @@ -241,8 +241,8 @@ class LinksData { $res = []; foreach ($items as $item) { - if (!isset($item['uid'])) { - $item['uid'] = self::uid(); + if (empty($item['uid'])) { + $item['uid'] = self::generateUID(); } $res[$item['uid']] = $item; } @@ -251,7 +251,7 @@ class LinksData protected static function uid() { - return Str::lower(Str::random(12)); + return static::generateUID(); } protected static function _fixLinks(&$links) @@ -266,6 +266,15 @@ class LinksData self::_fixInline($links); } + protected static function _fixID($links) + { + foreach ($links as $k => $link) { + if (empty($link['uid'])) { + $link['uid'] = self::generateUID(); + } + } + } + protected static function _fixInline(&$links) { foreach ($links as $k => $link) { -- 2.39.5