Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 7849-7854 (lines=6) @@
7846
    // Attachment ...
7847
    if (!empty($data_file)) {
7848
        $o = 0;
7849
        foreach ($data_file as $file_attach) {
7850
            if (!empty($file_attach['path']) && !empty($file_attach['filename'])) {
7851
                $mail->AddAttachment($file_attach['path'], $file_attach['filename']);
7852
            }
7853
            $o++;
7854
        }
7855
    } elseif (is_array($_FILES)) {
7856
        $data_file = $_FILES;
7857
        $o = 0;
@@ 7858-7863 (lines=6) @@
7855
    } elseif (is_array($_FILES)) {
7856
        $data_file = $_FILES;
7857
        $o = 0;
7858
        foreach ($data_file as $file_attach) {
7859
            if (!empty($file_attach['tmp_name']) && !empty($file_attach['name'])) {
7860
                $mail->AddAttachment($file_attach['tmp_name'], $file_attach['name']);
7861
            }
7862
            $o++;
7863
        }
7864
    }
7865
7866
    // Only valid addresses are accepted.