Fix error when handling values of GROUP_CONCAT (WBB3)
authorMarcel Werk <burntime@woltlab.com>
Thu, 23 Feb 2023 14:38:40 +0000 (15:38 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 23 Feb 2023 14:38:40 +0000 (15:38 +0100)
files/lib/system/exporter/WBB3xExporter.class.php

index 44c879bbcf1754f2dfc9cef5be8773bfb951baa2..6b748781974dbb9324ee3f8b20861a2a2eec574a 100644 (file)
@@ -217,8 +217,7 @@ class WBB3xExporter extends AbstractExporter
         ) {
             if (
                 empty($this->fileSystemPath)
-                || (
-                    !@\file_exists($this->fileSystemPath . 'lib/core.functions.php')
+                || (!@\file_exists($this->fileSystemPath . 'lib/core.functions.php')
                     && !@\file_exists($this->fileSystemPath . 'wcf/lib/core.functions.php')
                 )
             ) {
@@ -541,8 +540,8 @@ class WBB3xExporter extends AbstractExporter
                 'lastActivityTime' => $row['lastActivityTime'],
             ];
             $additionalData = [
-                'groupIDs' => \explode(',', $row['groupIDs']),
-                'languages' => \explode(',', $row['languageCodes']),
+                'groupIDs' => \explode(',', $row['groupIDs'] ?: ''),
+                'languages' => \explode(',', $row['languageCodes'] ?: ''),
                 'options' => [],
             ];
 
@@ -1037,7 +1036,7 @@ class WBB3xExporter extends AbstractExporter
         $statement = $this->database->prepareStatement($sql);
         $statement->execute([$offset + 1, $offset + $limit]);
         while ($row = $statement->fetchArray()) {
-            $participants = \explode(',', $row['participants']);
+            $participants = \explode(',', $row['participants'] ?: '');
             $participants[] = $row['userID'];
             $conversationID = $this->getConversationID($row['parentPmID'] ?: $row['pmID'], $participants);
 
@@ -1087,7 +1086,7 @@ class WBB3xExporter extends AbstractExporter
         $statement = $this->database->prepareStatement($sql);
         $statement->execute([$offset + 1, $offset + $limit]);
         while ($row = $statement->fetchArray()) {
-            $participants = \explode(',', $row['participants']);
+            $participants = \explode(',', $row['participants'] ?: '');
             $participants[] = $row['userID'];
             $conversationID = $this->getConversationID($row['parentPmID'] ?: $row['pmID'], $participants);
 
@@ -1146,7 +1145,7 @@ class WBB3xExporter 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['sender'];
             $conversationID = $this->getConversationID($row['parentPmID'] ?: $row['pmID'], $participants);
 
@@ -2250,7 +2249,7 @@ class WBB3xExporter extends AbstractExporter
         $conditionBuilder->add('entry_to_category.entryID IN (?)', [$entryIDs]);
         $conditionBuilder->add('category.userID = ?', [0]);
 
-        $sql = "SELECT      entry_to_category.* 
+        $sql = "SELECT      entry_to_category.*
                 FROM        wcf" . $this->dbNo . "_user_blog_entry_to_category entry_to_category
                 LEFT JOIN   wcf" . $this->dbNo . "_user_blog_category category
                 ON          category.categoryID = entry_to_category.categoryID