Remove obsolete code
authorMarcel Werk <burntime@woltlab.com>
Fri, 15 Mar 2024 14:25:20 +0000 (15:25 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 15 Mar 2024 14:25:20 +0000 (15:25 +0100)
The hash, file extension and dimensions are determined by the `UserAvatarImporter` anyway and do not need to be given as a parameter.

14 files changed:
files/lib/system/exporter/IPB3xExporter.class.php
files/lib/system/exporter/IPB4xExporter.class.php
files/lib/system/exporter/Kunena3xExporter.class.php
files/lib/system/exporter/MyBB16xExporter.class.php
files/lib/system/exporter/PhpBB31xExporter.class.php
files/lib/system/exporter/PhpBB3xExporter.class.php
files/lib/system/exporter/SMF2xExporter.class.php
files/lib/system/exporter/VB3or4xExporter.class.php
files/lib/system/exporter/VB5xExporter.class.php
files/lib/system/exporter/WBB2xExporter.class.php
files/lib/system/exporter/WBB3xExporter.class.php
files/lib/system/exporter/WBB4xExporter.class.php
files/lib/system/exporter/XF12xExporter.class.php
files/lib/system/exporter/XF2xExporter.class.php

index 9b77effff75d985481e067383f31882763a772f9..f6ad69976725f39b48aab11de5bd1ea30955a3af 100644 (file)
@@ -478,11 +478,8 @@ final class IPB3xExporter extends AbstractExporter
                 $source .= $row['avatar_location'];
             }
 
-            $avatarExtension = \pathinfo($avatarName, \PATHINFO_EXTENSION);
-
             $data = [
                 'avatarName' => $avatarName,
-                'avatarExtension' => $avatarExtension,
                 'userID' => $row['pp_member_id'],
             ];
 
index 7383f62e629f06dcf320d346449dbca1b7505973..0e2705486ebc0abb4a15d346592b3962d950df9b 100644 (file)
@@ -492,11 +492,9 @@ final class IPB4xExporter extends AbstractExporter
         while ($row = $statement->fetchArray()) {
             $avatarName = \basename($row['pp_main_photo']);
             $source = $this->fileSystemPath . 'uploads/' . $row['pp_main_photo'];
-            $avatarExtension = \pathinfo($avatarName, \PATHINFO_EXTENSION);
 
             $data = [
                 'avatarName' => $avatarName,
-                'avatarExtension' => $avatarExtension,
                 'userID' => $row['member_id'],
             ];
 
index 6e3c77f778481923bf71aa5e2341009b0587a0c4..29a6c3dd7041411ec9ef9e49874593ad3cbf0d98 100644 (file)
@@ -357,7 +357,6 @@ final class Kunena3xExporter extends AbstractExporter
 
             $data = [
                 'avatarName' => \basename($filepath),
-                'avatarExtension' => \pathinfo($filepath, \PATHINFO_EXTENSION),
                 'userID' => $row['userid'],
             ];
 
index d2454a2a9d9fcd8cd38fb0dcde39ac88c175faa8..80a5a93dd2505c2d87d47fdf72c2f3c30d49ac09 100644 (file)
@@ -620,13 +620,9 @@ final class MyBB16xExporter extends AbstractExporter
 
         while ($row = $statement->fetchArray()) {
             $path = Url::parse($row['avatar']);
-            [$width, $height] = \explode('|', $row['avatardimensions']);
 
             $data = [
                 'avatarName' => \basename($path['path']),
-                'avatarExtension' => \pathinfo($path['path'], \PATHINFO_EXTENSION),
-                'width' => $width,
-                'height' => $height,
                 'userID' => $row['uid'],
             ];
 
index d1011b5e66cc0e7af79387be499d7c0b33a4dac9..272eaad8180b1155ab6cdb865062716175fb911b 100644 (file)
@@ -720,7 +720,6 @@ final class PhpBB31xExporter extends AbstractExporter
 
             $data = [
                 'avatarName' => \basename($row['user_avatar']),
-                'avatarExtension' => $extension,
                 'userID' => $row['user_id'],
             ];
 
index 87b39c74d360972231035f66d896e96ce3ce0d44..f68cd40c24c4131e3483c2326faad15b5c390c59 100644 (file)
@@ -650,7 +650,6 @@ final class PhpBB3xExporter extends AbstractExporter
 
             $data = [
                 'avatarName' => \basename($row['user_avatar']),
-                'avatarExtension' => $extension,
                 'userID' => $row['user_id'],
             ];
 
index 9ad4368acfbcd6e5ad652c7253b8f209d2f91cce..1004448a5c19df0e475eed518ef66c9c9e475581 100644 (file)
@@ -689,7 +689,6 @@ final class SMF2xExporter extends AbstractExporter
 
             $data = [
                 'avatarName' => \basename($row['avatarName']),
-                'avatarExtension' => \pathinfo($row['avatarName'], \PATHINFO_EXTENSION),
                 'userID' => $row['id_member'],
             ];
 
index be254ad7fc7fa54a99b815243ec9698b277158a9..5db3a8b6fa62a8336c9c78ed8f314098f23e48a1 100644 (file)
@@ -773,9 +773,6 @@ final class VB3or4xExporter extends AbstractExporter
 
                 $data = [
                     'avatarName' => StringUtil::decodeHTML($row['filename']),
-                    'avatarExtension' => \pathinfo($row['filename'], \PATHINFO_EXTENSION),
-                    'width' => $row['width'],
-                    'height' => $row['height'],
                     'userID' => $row['userid'],
                 ];
 
index 3d5f9444c3d499272ea28aafe8b8d4c26b54a9b4..9662c3037d7b7daf701d0b5ade3edf2d2b4a2fcb 100644 (file)
@@ -497,9 +497,6 @@ final class VB5xExporter extends AbstractExporter
 
                 $data = [
                     'avatarName' => $row['filename'],
-                    'avatarExtension' => \pathinfo($row['filename'], \PATHINFO_EXTENSION),
-                    'width' => $row['width'],
-                    'height' => $row['height'],
                     'userID' => $row['userid'],
                 ];
 
index c91906b4e068baffa9c70140c1705f91f14e4e2e..f9fe5816a33b6e67a61cc2562bfc064ab04f512e 100644 (file)
@@ -454,9 +454,6 @@ final class WBB2xExporter extends AbstractExporter
 
             $data = [
                 'avatarName' => $row['avatarname'],
-                'avatarExtension' => $row['avatarextension'],
-                'width' => $row['width'],
-                'height' => $row['height'],
                 'userID' => $row['userid'],
             ];
 
index 4f7a35333764c80a0e7d042f5162e5bfa33f7ae2..01fd2dae2b63ddb90f4f46f0ed6c1048bd24b4cf 100644 (file)
@@ -777,9 +777,6 @@ final class WBB3xExporter extends AbstractExporter
 
             $data = [
                 'avatarName' => $row['avatarName'],
-                'avatarExtension' => $row['avatarExtension'],
-                'width' => $row['width'],
-                'height' => $row['height'],
                 'userID' => $row['userID'],
             ];
 
index 81101f281e78b7cfaa54b7e9f76907a1dc033701..fe3c66ef9621efaa75e95ed55bc9545ac38b19e5 100644 (file)
@@ -827,11 +827,7 @@ final class WBB4xExporter extends AbstractExporter
 
             $data = [
                 'avatarName' => $row['avatarName'],
-                'avatarExtension' => $row['avatarExtension'],
-                'width' => $row['width'],
-                'height' => $row['height'],
                 'userID' => $row['userID'],
-                'fileHash' => $row['fileHash'],
             ];
 
             ImportHandler::getInstance()
index 157a2fba07cf31cd794e04836b971e0eb1e4692d..4cc3f9931c2ea360301946aba3f694cc8bcee19a 100644 (file)
@@ -719,25 +719,8 @@ final class XF12xExporter extends AbstractExporter
             $config = $this->getConfig();
             $location = $this->fileSystemPath . $config['externalDataPath'] . '/avatars/l/' . \floor($row['user_id'] / 1000) . '/' . $row['user_id'] . '.jpg';
 
-            if (!$imageSize = @\getimagesize($location)) {
-                continue;
-            }
-
-            switch ($imageSize[2]) {
-                case \IMAGETYPE_JPEG:
-                    $extension = 'jpg';
-                    break;
-                case \IMAGETYPE_PNG:
-                    $extension = 'png';
-                    break;
-                case \IMAGETYPE_GIF:
-                    $extension = 'gif';
-            }
-
-            /** @noinspection PhpUndefinedVariableInspection */
             $data = [
                 'avatarName' => '',
-                'avatarExtension' => $extension,
                 'userID' => $row['user_id'],
             ];
 
@@ -918,7 +901,8 @@ final class XF12xExporter extends AbstractExporter
                     0,
                     $data,
                     [
-                        'labelIDs' => $row['is_starred'] ? [$row['user_id']] : [], ]
+                        'labelIDs' => $row['is_starred'] ? [$row['user_id']] : [],
+                    ]
                 );
         }
     }
index 35fb0c3a7dcb1b88cdb5cce3cdf9bcd8b9c56384..1c5218946b18a092eae6c29157a14483b78d0882 100644 (file)
@@ -759,25 +759,8 @@ final class XF2xExporter extends AbstractExporter
             $config = $this->getConfig();
             $location = $this->fileSystemPath . $config['externalDataPath'] . '/avatars/l/' . \floor($row['user_id'] / 1000) . '/' . $row['user_id'] . '.jpg';
 
-            if (!$imageSize = @\getimagesize($location)) {
-                continue;
-            }
-
-            switch ($imageSize[2]) {
-                case \IMAGETYPE_JPEG:
-                    $extension = 'jpg';
-                    break;
-                case \IMAGETYPE_PNG:
-                    $extension = 'png';
-                    break;
-                case \IMAGETYPE_GIF:
-                    $extension = 'gif';
-            }
-
-            /** @noinspection PhpUndefinedVariableInspection */
             $data = [
                 'avatarName' => '',
-                'avatarExtension' => $extension,
                 'userID' => $row['user_id'],
             ];
 
@@ -958,7 +941,8 @@ final class XF2xExporter extends AbstractExporter
                     0,
                     $data,
                     [
-                        'labelIDs' => $row['is_starred'] ? [$row['user_id']] : [], ]
+                        'labelIDs' => $row['is_starred'] ? [$row['user_id']] : [],
+                    ]
                 );
         }
     }