Code Duplication    Length = 6-6 lines in 2 locations

main/inc/lib/api.lib.php 2 locations

@@ 7973-7978 (lines=6) @@
7970
    // Attachment ...
7971
    if (!empty($data_file)) {
7972
        $o = 0;
7973
        foreach ($data_file as $file_attach) {
7974
            if (!empty($file_attach['path']) && !empty($file_attach['filename'])) {
7975
                $mail->AddAttachment($file_attach['path'], $file_attach['filename']);
7976
            }
7977
            $o++;
7978
        }
7979
    } elseif (is_array($_FILES)) {
7980
        $data_file = $_FILES;
7981
        $o = 0;
@@ 7982-7987 (lines=6) @@
7979
    } elseif (is_array($_FILES)) {
7980
        $data_file = $_FILES;
7981
        $o = 0;
7982
        foreach ($data_file as $file_attach) {
7983
            if (!empty($file_attach['tmp_name']) && !empty($file_attach['name'])) {
7984
                $mail->AddAttachment($file_attach['tmp_name'], $file_attach['name']);
7985
            }
7986
            $o++;
7987
        }
7988
    }
7989
7990
    // Only valid addresses are accepted.