From 8016f5c67c7ff77b9e647f0a99b6949b1d0c816a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Apr 2023 18:47:51 +0000 Subject: [PATCH 1/2] Fixes "Trying to access array offset on value of type bool" --- src/Factory/Api/Mastodon/Attachment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Factory/Api/Mastodon/Attachment.php b/src/Factory/Api/Mastodon/Attachment.php index afc2f7c27..6f881808e 100644 --- a/src/Factory/Api/Mastodon/Attachment.php +++ b/src/Factory/Api/Mastodon/Attachment.php @@ -136,7 +136,7 @@ class Attachment extends BaseFactory $url = $this->baseUrl . '/photo/' . $photo['resource-id'] . '-0.' . $ext; $preview = Photo::selectFirst(['scale'], ["`resource-id` = ? AND `uid` = ? AND `scale` > ?", $photo['resource-id'], $photo['uid'], 0], ['order' => ['scale']]); - if (empty($scale)) { + if (!empty($preview)) { $preview_url = $this->baseUrl . '/photo/' . $photo['resource-id'] . '-' . $preview['scale'] . '.' . $ext; } else { $preview_url = ''; From 504433581ad1ff5dbe5f9c357a6300f325c12f0f Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 12 Apr 2023 03:30:59 +0000 Subject: [PATCH 2/2] Fixed check for likes in notification mail --- src/Navigation/Notifications/Repository/Notify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Navigation/Notifications/Repository/Notify.php b/src/Navigation/Notifications/Repository/Notify.php index d1256f7d9..8bfdfbe9a 100644 --- a/src/Navigation/Notifications/Repository/Notify.php +++ b/src/Navigation/Notifications/Repository/Notify.php @@ -785,7 +785,7 @@ class Notify extends BaseRepository $params['type'] = Model\Notification\Type::COMMENT; $subject = $l10n->t('%1$s Comment to conversation #%2$d by %3$s', $subjectPrefix, $item['parent'], $contact['name']); - if ($params['verb'] = Activity::LIKE) { + if ($params['verb'] == Activity::LIKE) { switch ($Notification->type) { case Model\Post\UserNotification::TYPE_DIRECT_COMMENT: $subject = $l10n->t('%1$s %2$s liked your post #%3$d', $subjectPrefix, $contact['name'], $item['parent']);