diff --git a/src/PHPMailerEnhanced/PHPMailerEnhanced.php b/src/PHPMailerEnhanced/PHPMailerEnhanced.php index fa358b2..cbe0ecb 100644 --- a/src/PHPMailerEnhanced/PHPMailerEnhanced.php +++ b/src/PHPMailerEnhanced/PHPMailerEnhanced.php @@ -210,7 +210,8 @@ class PHPMailerEnhanced extends PHPMailer { //region Check the link has no protocol (http, cid, etc.) or it's “file” if (preg_match('#^(?:(?[a-z][a-z\d+.-]*):)?(?.+)$#i', $link, $match) === 1) { - if (($match['protocol'] ?? '') !== 'file') { + $protocol = $match['protocol'] ?? 'file'; + if ($protocol !== '' && $protocol !== 'file') { return $link; } else {