Code Duplication    Length = 11-11 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 4642-4652 (lines=11) @@
4639
    $fileCount = count($_FILES['user_upload']['name']);
4640
    $filesData = [];
4641
4642
    if (!is_array($_FILES['user_upload']['name'])) {
4643
        $filesData[] = $_FILES['user_upload'];
4644
    } else {
4645
        $fileKeys = array_keys($_FILES['user_upload']);
4646
        for ($i = 0; $i < $fileCount; $i++) {
4647
            foreach ($fileKeys as $key) {
4648
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4649
            }
4650
        }
4651
    }
4652
4653
    foreach ($filesData as $attachment) {
4654
        if (empty($attachment['name'])) {
4655
            continue;
@@ 4732-4742 (lines=11) @@
4729
    $fileCount = count($_FILES['user_upload']['name']);
4730
    $filesData = [];
4731
4732
    if (!is_array($_FILES['user_upload']['name'])) {
4733
        $filesData[] = $_FILES['user_upload'];
4734
    } else {
4735
        $fileKeys = array_keys($_FILES['user_upload']);
4736
4737
        for ($i = 0; $i < $fileCount; $i++) {
4738
            foreach ($fileKeys as $key) {
4739
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4740
            }
4741
        }
4742
    }
4743
4744
    foreach ($filesData as $attachment) {
4745
        if (empty($attachment['name'])) {