From 111df607bce5acc9fcf6c9b54daa86b4d67cb742 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 6 Mar 2024 12:01:25 -0500 Subject: [PATCH 1/2] Don't call mb_strlen() on $body if it isn't set in Model\Post\Counts - Address https://github.com/friendica/friendica/issues/13761#issuecomment-1978354153 --- src/Model/Post/Counts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Post/Counts.php b/src/Model/Post/Counts.php index 1b04636447..66d6bddad3 100644 --- a/src/Model/Post/Counts.php +++ b/src/Model/Post/Counts.php @@ -43,7 +43,7 @@ class Counts Activity::EMOJIREACT, Activity::ANNOUNCE, Activity::VIEW, Activity::READ])) { return true; } - + $condition = ['thr-parent-id' => $uri_id, 'vid' => $vid, 'deleted' => false]; if ($body == $verb) { @@ -52,7 +52,7 @@ class Counts } elseif ($verb == Activity::POST) { $condition['gravity'] = Item::GRAVITY_COMMENT; $body = ''; - } elseif (($verb != Activity::POST) && (mb_strlen($body) == 1) && Smilies::isEmojiPost($body)) { + } elseif ($body && mb_strlen($body) == 1 && Smilies::isEmojiPost($body)) { $condition['body'] = $body; } else { $body = ''; From 8c4b2107b5e57d75b35cb38ba4dcf65a1c7f05a0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 6 Mar 2024 12:07:43 -0500 Subject: [PATCH 2/2] Include author-alias to the field list in mod/photos - It's used to generate magic links of authors of comments on photos - Address https://github.com/friendica/friendica/issues/13761#issuecomment-1980738080 --- mod/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index a8a62e8964..95f95048b4 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1039,7 +1039,7 @@ function photos_content(App $a) $pager = new Pager(DI::l10n(), DI::args()->getQueryString()); $params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]]; - $items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params)); + $items = Post::toArray(Post::selectForUser($link_item['uid'], array_merge(Item::ITEM_FIELDLIST, ['author-alias']), $condition, $params)); if (DI::userSession()->getLocalUserId() == $link_item['uid']) { Item::update(['unseen' => false], ['parent' => $link_item['parent']]);