From d7ccddb0a8b1b686745accc672119c2b8bc231f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 15 Mar 2021 16:31:51 +0100 Subject: [PATCH] Remove useless check for non-emptiness of $groupIDs --- .../system/importer/UserImporter.class.php | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php index bc981942e2..967b18dfe7 100644 --- a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php @@ -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 -- 2.20.1