Code Duplication    Length = 11-11 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 4788-4798 (lines=11) @@
4785
4786
    $filesData = [];
4787
4788
    if (!is_array($_FILES['user_upload']['name'])) {
4789
        $filesData[] = $_FILES['user_upload'];
4790
    } else {
4791
        $fileKeys = array_keys($_FILES['user_upload']);
4792
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'])) {
@@ 4880-4890 (lines=11) @@
4877
4878
    $filesData = [];
4879
4880
    if (!is_array($_FILES['user_upload']['name'])) {
4881
        $filesData[] = $_FILES['user_upload'];
4882
    } else {
4883
        $fileKeys = array_keys($_FILES['user_upload']);
4884
4885
        for ($i = 0; $i < $fileCount; $i++) {
4886
            foreach ($fileKeys as $key) {
4887
                $filesData[$i][$key] = $_FILES['user_upload'][$key][$i];
4888
            }
4889
        }
4890
    }
4891
4892
    foreach ($filesData as $attachment) {
4893
        if (empty($attachment['name'])) {