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
This commit is contained in:
Hypolite Petovan 2024-03-06 12:01:25 -05:00
parent b8b76e870d
commit 111df607bc

View File

@ -43,7 +43,7 @@ class Counts
Activity::EMOJIREACT, Activity::ANNOUNCE, Activity::VIEW, Activity::READ])) { Activity::EMOJIREACT, Activity::ANNOUNCE, Activity::VIEW, Activity::READ])) {
return true; return true;
} }
$condition = ['thr-parent-id' => $uri_id, 'vid' => $vid, 'deleted' => false]; $condition = ['thr-parent-id' => $uri_id, 'vid' => $vid, 'deleted' => false];
if ($body == $verb) { if ($body == $verb) {
@ -52,7 +52,7 @@ class Counts
} elseif ($verb == Activity::POST) { } elseif ($verb == Activity::POST) {
$condition['gravity'] = Item::GRAVITY_COMMENT; $condition['gravity'] = Item::GRAVITY_COMMENT;
$body = ''; $body = '';
} elseif (($verb != Activity::POST) && (mb_strlen($body) == 1) && Smilies::isEmojiPost($body)) { } elseif ($body && mb_strlen($body) == 1 && Smilies::isEmojiPost($body)) {
$condition['body'] = $body; $condition['body'] = $body;
} else { } else {
$body = ''; $body = '';