From: Vincent Vanwaelscappel Date: Fri, 1 Sep 2023 10:19:17 +0000 (+0200) Subject: wait #6235 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f95f69e52d4f728ed7b55b4542625779bcb05400;p=fluidbook-toolbox.git wait #6235 @0.25 --- 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) {