Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 8010-8015 (lines=6) @@
8007
    // Attachment ...
8008
    if (!empty($data_file)) {
8009
        $o = 0;
8010
        foreach ($data_file as $file_attach) {
8011
            if (!empty($file_attach['path']) && !empty($file_attach['filename'])) {
8012
                $mail->AddAttachment($file_attach['path'], $file_attach['filename']);
8013
            }
8014
            $o++;
8015
        }
8016
    } elseif (is_array($_FILES)) {
8017
        $data_file = $_FILES;
8018
        $o = 0;
@@ 8019-8024 (lines=6) @@
8016
    } elseif (is_array($_FILES)) {
8017
        $data_file = $_FILES;
8018
        $o = 0;
8019
        foreach ($data_file as $file_attach) {
8020
            if (!empty($file_attach['tmp_name']) && !empty($file_attach['name'])) {
8021
                $mail->AddAttachment($file_attach['tmp_name'], $file_attach['name']);
8022
            }
8023
            $o++;
8024
        }
8025
    }
8026
8027
    // Only valid addresses are accepted.