From: Marcel Werk Date: Tue, 7 May 2024 11:56:08 +0000 (+0200) Subject: Fix several 'deprecated' issues in the PHPBB3.1+ exporter X-Git-Tag: 6.0.14~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=da0939c253270dcdadb860813e6c425fa1f6aa03;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.exporter.git Fix several 'deprecated' issues in the PHPBB3.1+ exporter --- diff --git a/files/lib/system/exporter/PhpBB31xExporter.class.php b/files/lib/system/exporter/PhpBB31xExporter.class.php index d1011b5..df2b033 100644 --- a/files/lib/system/exporter/PhpBB31xExporter.class.php +++ b/files/lib/system/exporter/PhpBB31xExporter.class.php @@ -393,7 +393,7 @@ final class PhpBB31xExporter extends AbstractExporter ]; $additionalData = [ - 'groupIDs' => \explode(',', $row['groupIDs']), + 'groupIDs' => \explode(',', $row['groupIDs'] ?: ''), 'languages' => [$row['user_lang']], 'options' => $options, ]; @@ -853,7 +853,7 @@ final class PhpBB31xExporter extends AbstractExporter $statement->execute([0]); while ($row = $statement->fetchArray()) { if (!$row['isDraft']) { - $participants = \explode(',', $row['participants']); + $participants = \explode(',', $row['participants'] ?: ''); $participants[] = $row['author_id']; $conversationID = $this->getConversationID($row['root_level'] ?: $row['msg_id'], $participants); @@ -866,7 +866,7 @@ final class PhpBB31xExporter extends AbstractExporter 'subject' => StringUtil::decodeHTML($row['message_subject']), 'time' => $row['message_time'], 'userID' => $row['author_id'], - 'username' => StringUtil::decodeHTML($row['username']) ?: '', + 'username' => StringUtil::decodeHTML($row['username'] ?: ''), 'isDraft' => $row['isDraft'], ]; @@ -951,14 +951,14 @@ final class PhpBB31xExporter extends AbstractExporter $statement = $this->database->prepareStatement($sql, $limit, $offset); $statement->execute([1, 0]); while ($row = $statement->fetchArray()) { - $participants = \explode(',', $row['participants']); + $participants = \explode(',', $row['participants'] ?: ''); $participants[] = $row['author_id']; $conversationID = $this->getConversationID($row['root_level'] ?: $row['msg_id'], $participants); $data = [ 'conversationID' => $conversationID, 'userID' => $row['author_id'], - 'username' => StringUtil::decodeHTML($row['username']) ?: '', + 'username' => StringUtil::decodeHTML($row['username'] ?: ''), 'message' => self::fixBBCodes($row['message_text'], $row['bbcode_uid']), 'time' => $row['message_time'], 'attachments' => $row['attachments'], @@ -1009,16 +1009,16 @@ final class PhpBB31xExporter extends AbstractExporter $statement = $this->database->prepareStatement($sql, $limit, $offset); $statement->execute(); while ($row = $statement->fetchArray()) { - $participants = \explode(',', $row['participants']); + $participants = \explode(',', $row['participants'] ?: ''); $participants[] = $row['author_id']; $conversationID = $this->getConversationID($row['root_level'] ?: $row['msg_id'], $participants); - $bcc = \explode(':', $row['bcc_address']); + $bcc = \explode(':', $row['bcc_address'] ?: ''); $data = [ 'conversationID' => $conversationID, 'participantID' => $row['user_id'], - 'username' => StringUtil::decodeHTML($row['username']) ?: '', + 'username' => StringUtil::decodeHTML($row['username'] ?: ''), 'hideConversation' => $row['pm_deleted'], 'isInvisible' => \in_array('u_' . $row['user_id'], $bcc) ? 1 : 0, 'lastVisitTime' => $row['pm_new'] ? 0 : $row['message_time'], @@ -1228,8 +1228,8 @@ final class PhpBB31xExporter extends AbstractExporter $data = [ 'threadID' => $row['topic_id'], 'userID' => $row['poster_id'], - 'username' => $row['post_username'] ?: (StringUtil::decodeHTML($row['username']) ?: ''), - 'subject' => StringUtil::decodeHTML($row['post_subject']), + 'username' => $row['post_username'] ?: StringUtil::decodeHTML($row['username'] ?: ''), + 'subject' => StringUtil::decodeHTML($row['post_subject'] ?: ''), 'message' => self::fixBBCodes($row['post_text'], $row['bbcode_uid']), 'time' => $row['post_time'], 'isDisabled' => $row['post_visibility'] == self::ITEM_UNAPPROVED ? 1 : 0,