From: Tim Düsterhus Date: Mon, 15 Mar 2021 15:31:51 +0000 (+0100) Subject: Remove useless check for non-emptiness of $groupIDs X-Git-Tag: 5.4.0_Alpha_1~154^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d7ccddb0a8b1b686745accc672119c2b8bc231f8;p=GitHub%2FWoltLab%2FWCF.git Remove useless check for non-emptiness of $groupIDs --- 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