Remove useless check for non-emptiness of $groupIDs
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 15 Mar 2021 15:31:51 +0000 (16:31 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 15 Mar 2021 15:31:51 +0000 (16:31 +0100)
wcfsetup/install/files/lib/system/importer/UserImporter.class.php

index bc981942e2797a125e8958b4f651d5547a3bff5b..967b18dfe7b62d67939426a2176268a87138409a 100644 (file)
@@ -224,19 +224,17 @@ class UserImporter extends AbstractImporter
             $groupIDs,
             $this->defaultGroups[$user->pendingActivation() ? 'notActivated' : 'activated']
         );
-        if (!empty($groupIDs)) {
-            $placeholders = '(?,?)' . \str_repeat(',(?,?)', \count($groupIDs) - 1);
-            $sql = "INSERT IGNORE INTO  wcf" . WCF_N . "_user_to_group
-                                        (userID, groupID)
-                    VALUES              {$placeholders}";
-            $statement = WCF::getDB()->prepareStatement($sql);
-            $parameters = [];
-            foreach ($groupIDs as $groupID) {
-                $parameters[] = $user->userID;
-                $parameters[] = $groupID;
-            }
-            $statement->execute($parameters);
+        $placeholders = '(?,?)' . \str_repeat(',(?,?)', \count($groupIDs) - 1);
+        $sql = "INSERT IGNORE INTO  wcf" . WCF_N . "_user_to_group
+                                    (userID, groupID)
+                VALUES              {$placeholders}";
+        $statement = WCF::getDB()->prepareStatement($sql);
+        $parameters = [];
+        foreach ($groupIDs as $groupID) {
+            $parameters[] = $user->userID;
+            $parameters[] = $groupID;
         }
+        $statement->execute($parameters);
 
         // save languages
         $sql = "INSERT IGNORE INTO  wcf" . WCF_N . "_user_to_language