From cf1fba1efe78d0bf934b5cf8bb065866b5ad2b97 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 26 Dec 2019 18:41:51 +0100 Subject: [PATCH] Support for attachments with the `.bin` extensions (WoltLab Suite 5.2+) Fixes #36 --- files/lib/system/exporter/WBB4xExporter.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/lib/system/exporter/WBB4xExporter.class.php b/files/lib/system/exporter/WBB4xExporter.class.php index 0e3e657..e39102d 100644 --- a/files/lib/system/exporter/WBB4xExporter.class.php +++ b/files/lib/system/exporter/WBB4xExporter.class.php @@ -3080,6 +3080,11 @@ class WBB4xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { $fileLocation = $this->fileSystemPath . 'attachments/' . substr($row['fileHash'], 0, 2) . '/' . $row['attachmentID'] . '-' . $row['fileHash']; + // WoltLab Suite 5.2 uses the `.bin` extension for attachments. + if (!is_readable($fileLocation) && is_readable("{$fileLocation}.bin")) { + $fileLocation .= '.bin'; + } + ImportHandler::getInstance()->getImporter($importer)->import($row['attachmentID'], [ 'objectID' => $row['objectID'], 'userID' => $row['userID'] ?: null, -- 2.20.1