Code Duplication    Length = 6-6 lines in 2 locations

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

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