Code Duplication    Length = 11-11 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 4678-4688 (lines=11) @@
4675
    $fileCount = count($_FILES['user_upload']['name']);
4676
    $filesData = [];
4677
4678
    if (!is_array($_FILES['user_upload']['name'])) {
4679
        $filesData[] = $_FILES['user_upload'];
4680
    } else {
4681
        $fileKeys = array_keys($_FILES['user_upload']);
4682
        for ($i = 0; $i < $fileCount; $i++) {
4683
            foreach ($fileKeys as $key) {
4684
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4685
            }
4686
        }
4687
    }
4688
4689
    foreach ($filesData as $attachment) {
4690
        if (empty($attachment['name'])) {
4691
            continue;
@@ 4768-4778 (lines=11) @@
4765
    $fileCount = count($_FILES['user_upload']['name']);
4766
    $filesData = [];
4767
4768
    if (!is_array($_FILES['user_upload']['name'])) {
4769
        $filesData[] = $_FILES['user_upload'];
4770
    } else {
4771
        $fileKeys = array_keys($_FILES['user_upload']);
4772
4773
        for ($i = 0; $i < $fileCount; $i++) {
4774
            foreach ($fileKeys as $key) {
4775
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4776
            }
4777
        }
4778
    }
4779
4780
    foreach ($filesData as $attachment) {
4781
        if (empty($attachment['name'])) {