Code Duplication    Length = 11-11 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 4789-4799 (lines=11) @@
4786
    $fileCount = count($_FILES['user_upload']['name']);
4787
    $filesData = [];
4788
4789
    if (!is_array($_FILES['user_upload']['name'])) {
4790
        $filesData[] = $_FILES['user_upload'];
4791
    } else {
4792
        $fileKeys = array_keys($_FILES['user_upload']);
4793
        for ($i = 0; $i < $fileCount; $i++) {
4794
            foreach ($fileKeys as $key) {
4795
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4796
            }
4797
        }
4798
    }
4799
4800
    foreach ($filesData as $attachment) {
4801
        if (empty($attachment['name'])) {
4802
            continue;
@@ 4879-4889 (lines=11) @@
4876
    $fileCount = count($_FILES['user_upload']['name']);
4877
    $filesData = [];
4878
4879
    if (!is_array($_FILES['user_upload']['name'])) {
4880
        $filesData[] = $_FILES['user_upload'];
4881
    } else {
4882
        $fileKeys = array_keys($_FILES['user_upload']);
4883
4884
        for ($i = 0; $i < $fileCount; $i++) {
4885
            foreach ($fileKeys as $key) {
4886
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4887
            }
4888
        }
4889
    }
4890
4891
    foreach ($filesData as $attachment) {
4892
        if (empty($attachment['name'])) {