Code Duplication    Length = 3-3 lines in 2 locations

include/functions.php 1 location

@@ 602-604 (lines=3) @@
599
    $attachmentAsattachmentCriteria->setOrder('ASC');
600
    $attachmentObjs  = $helper->getHandler('Attachment')->getObjects($attachmentAsattachmentCriteria, true);
601
    $attachmentsPath = [];
602
    foreach ($attachmentObjs as $attachment_id => $attachmentObj) {
603
        $attachmentsPath[] = XOOPS_UPLOAD_PATH . $helper->getConfig('xn_attachment_path') . $letter_id . '/' . $attachmentObj->getVar('attachment_name');
604
    }
605
606
    $mail           = new Xnewsletter\XnewsletterMailer();
607
    $mail->CharSet  = _CHARSET; //use xoops default character set

include/task.inc.php 1 location

@@ 317-319 (lines=3) @@
314
        $attachmentAsattachmentCriteria->setOrder('ASC');
315
        $attachmentObjs  = $helper->getHandler('Attachment')->getObjects($attachmentAsattachmentCriteria, true);
316
        $attachmentsPath = [];
317
        foreach ($attachmentObjs as $attachment_id => $attachmentObj) {
318
            $attachmentsPath[] = XOOPS_UPLOAD_PATH . $helper->getConfig('xn_attachment_path') . $letter_id . '/' . $attachmentObj->getVar('attachment_name');
319
        }
320
321
        try {
322
            if (_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL == $account_type) {