From db33800ade22926701e6bdbe5acefa2ebb271b02 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Mon, 29 Nov 2021 14:38:06 +0000 Subject: [PATCH] [PLUGINS][Reply] Array key 'reply_to' checked if it exists. Plugin\Reply\Entity\NoteReply::getReplyToNote lacked a check to make sure the 'reply_to' key existed within the array resulting from the query. --- plugins/Reply/Entity/NoteReply.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Reply/Entity/NoteReply.php b/plugins/Reply/Entity/NoteReply.php index 50f8107368..3112b911ea 100644 --- a/plugins/Reply/Entity/NoteReply.php +++ b/plugins/Reply/Entity/NoteReply.php @@ -95,7 +95,7 @@ class NoteReply extends Entity $result = DB::dql('select nr.reply_to from note_reply nr ' . 'where nr.note_id = :note_id', ['note_id' => $note->getId()], ); - if (!empty($result)) { + if (!\is_null($result) && \array_key_exists('reply_to', $result)) { return $result['reply_to']; }