Skip to content

Commit 9890ece

Browse files
committed
Add guard to attachments code.
1 parent efce854 commit 9890ece

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Linker.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: PHPMailer-phpMussel linker (last modified: 2020.07.02).
11+
* This file: PHPMailer-phpMussel linker (last modified: 2020.07.12).
1212
*/
1313

1414
namespace phpMussel\PHPMailer;
@@ -21,12 +21,12 @@ class Linker
2121
private $Loader;
2222

2323
/**
24-
* @var string The path to the core asset files.
24+
* @var string The path to the linker asset files.
2525
*/
2626
private $AssetsPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR;
2727

2828
/**
29-
* @var string The path to the core L10N files.
29+
* @var string The path to the linker L10N files.
3030
*/
3131
private $L10NPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'l10n' . DIRECTORY_SEPARATOR;
3232

@@ -224,8 +224,10 @@ public function __invoke(string $NotUsed, array $Data): bool
224224
$Mail->AltBody = $AltBody;
225225

226226
/** Process attachments. */
227-
foreach ($Attachments as $Attachment) {
228-
$Mail->addAttachment($Attachment);
227+
if (is_array($Attachments)) {
228+
foreach ($Attachments as $Attachment) {
229+
$Mail->addAttachment($Attachment);
230+
}
229231
}
230232

231233
/** Send it! */

0 commit comments

Comments
 (0)