Code Duplication    Length = 11-11 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 4656-4666 (lines=11) @@
4653
4654
    $filesData = [];
4655
4656
    if (!is_array($_FILES['user_upload']['name'])) {
4657
        $filesData[] = $_FILES['user_upload'];
4658
    } else {
4659
        $fileKeys = array_keys($_FILES['user_upload']);
4660
4661
        for ($i = 0; $i < $fileCount; $i++) {
4662
            foreach ($fileKeys as $key) {
4663
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4664
            }
4665
        }
4666
    }
4667
4668
    foreach ($filesData as $attachment) {
4669
        if (empty($attachment['name'])) {
@@ 4748-4758 (lines=11) @@
4745
4746
    $filesData = [];
4747
4748
    if (!is_array($_FILES['user_upload']['name'])) {
4749
        $filesData[] = $_FILES['user_upload'];
4750
    } else {
4751
        $fileKeys = array_keys($_FILES['user_upload']);
4752
4753
        for ($i = 0; $i < $fileCount; $i++) {
4754
            foreach ($fileKeys as $key) {
4755
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4756
            }
4757
        }
4758
    }
4759
4760
    foreach ($filesData as $attachment) {
4761
        if (empty($attachment['name'])) {