From 09091c7c231282af5d8494ed0d258f9971f3e46d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 7 Jun 2024 12:03:24 +0200 Subject: [PATCH] Fix the handling of an empty list of participants --- files/lib/system/exporter/SMF2xExporter.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/files/lib/system/exporter/SMF2xExporter.class.php b/files/lib/system/exporter/SMF2xExporter.class.php index 9ad4368..c4966e9 100644 --- a/files/lib/system/exporter/SMF2xExporter.class.php +++ b/files/lib/system/exporter/SMF2xExporter.class.php @@ -840,7 +840,12 @@ final class SMF2xExporter extends AbstractExporter $statement = $this->database->prepareStatement($sql); $statement->execute([$offset + 1, $offset + $limit]); while ($row = $statement->fetchArray()) { - $participants = \explode(',', $row['participants']); + if ($row['participants'] === null) { + $participants = []; + } else { + $participants = \explode(',', $row['participants']); + } + $participants[] = $row['id_member_from']; $conversationID = $this->getConversationID($row['id_pm_head'], $participants); @@ -890,7 +895,12 @@ final class SMF2xExporter extends AbstractExporter $statement = $this->database->prepareStatement($sql); $statement->execute([$offset + 1, $offset + $limit]); while ($row = $statement->fetchArray()) { - $participants = \explode(',', $row['participants']); + if ($row['participants'] === null) { + $participants = []; + } else { + $participants = \explode(',', $row['participants']); + } + $participants[] = $row['id_member_from']; $conversationID = $this->getConversationID($row['id_pm_head'], $participants); -- 2.20.1