Remove obsolete code
authorMarcel Werk <burntime@woltlab.com>
Fri, 15 Mar 2024 14:29:19 +0000 (15:29 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 15 Mar 2024 14:29:19 +0000 (15:29 +0100)
There parameters are determined by the `MediaImporter` anyway and do not need to be given as a parameter.

files/lib/system/exporter/WBB4xExporter.class.php
files/lib/system/exporter/WordPress3xExporter.class.php

index fe3c66ef9621efaa75e95ed55bc9545ac38b19e5..aac6901f76eb33a756a0f0110367fd9f2fb08d70 100644 (file)
@@ -3631,15 +3631,9 @@ final class WBB4xExporter extends AbstractExporter
             $data = [
                 'categoryID' => (!empty($row['categoryID']) ? $row['categoryID'] : null),
                 'filename' => $row['filename'],
-                'filesize' => $row['filesize'],
-                'fileType' => $row['fileType'],
-                'fileHash' => $row['fileHash'],
                 'uploadTime' => $row['uploadTime'],
                 'userID' => $row['userID'],
                 'username' => $row['username'],
-                'isImage' => $row['isImage'],
-                'width' => $row['width'],
-                'height' => $row['height'],
             ];
 
             $additionalData = [
index e842b1686f6314b50a2a90d04d4efd555c36a6da..a44c2cb2282b4be679b3f6ad6616897e1b0d4ac4 100644 (file)
@@ -534,23 +534,6 @@ final class WordPress3xExporter extends AbstractExporter
                 continue;
             }
 
-            $isImage = $width = $height = 0;
-            if (
-                $row['post_mime_type'] == 'image/jpeg'
-                || $row['post_mime_type'] == 'image/png'
-                || $row['post_mime_type'] == 'image/gif'
-            ) {
-                $isImage = 1;
-            }
-            if ($isImage) {
-                $imageData = @\getimagesize($fileLocation);
-                if ($imageData === false) {
-                    continue;
-                }
-                $width = $imageData[0];
-                $height = $imageData[1];
-            }
-
             $time = @\strtotime($row['post_date_gmt']);
             if (!$time) {
                 $time = @\strtotime($row['post_date']);
@@ -558,14 +541,8 @@ final class WordPress3xExporter extends AbstractExporter
 
             $data = [
                 'filename' => \basename($fileLocation),
-                'filesize' => \filesize($fileLocation),
-                'fileType' => $row['post_mime_type'],
-                'fileHash' => \md5_file($fileLocation),
                 'uploadTime' => $time,
                 'userID' => $row['post_author'] ?: null,
-                'isImage' => $isImage,
-                'width' => $width,
-                'height' => $height,
             ];
 
             ImportHandler::getInstance()