Code Duplication    Length = 6-6 lines in 2 locations

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

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