From: Michael Date: Wed, 25 Mar 2020 07:07:34 +0000 (+0000) Subject: Issue 8254: Length restriction for "title" and "uri" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0486050d96e8edc175d254c5f002955e3dba743d;p=friendica.git Issue 8254: Length restriction for "title" and "uri" --- diff --git a/src/Model/Item.php b/src/Model/Item.php index f5b626b426..08007fb4bd 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1429,7 +1429,7 @@ class Item } $item['guid'] = self::guid($item, $notify); - $item['uri'] = Strings::escapeTags(trim(($item['uri'] ?? '') ?: self::newURI($item['uid'], $item['guid']))); + $item['uri'] = substr(Strings::escapeTags(trim(($item['uri'] ?? '') ?: self::newURI($item['uid'], $item['guid']))), 0, 255); // Store URI data $item['uri-id'] = ItemURI::insert(['uri' => $item['uri'], 'guid' => $item['guid']]); @@ -1546,7 +1546,7 @@ class Item $item['edited'] = (isset($item['edited']) ? DateTimeFormat::utc($item['edited']) : $item['created']); $item['changed'] = (isset($item['changed']) ? DateTimeFormat::utc($item['changed']) : $item['created']); $item['commented'] = (isset($item['commented']) ? DateTimeFormat::utc($item['commented']) : $item['created']); - $item['title'] = trim($item['title'] ?? ''); + $item['title'] = substr(trim($item['title'] ?? ''), 0, 255); $item['location'] = trim($item['location'] ?? ''); $item['coord'] = trim($item['coord'] ?? ''); $item['visible'] = (isset($item['visible']) ? intval($item['visible']) : 1);