Skip to content

Commit fb7013f

Browse files
bramleymarianaballa
authored andcommitted
Use PHPMAILER_PATH only when it appears to be valid. For PHPMailer 5 it should be a file and for PHPMailer 6 it should be a directory.
1 parent 68a3758 commit fb7013f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

public_html/lists/admin/class.phplistmailerbase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function ($classname)
88
$prefixLength = strlen($prefix);
99

1010
if (substr($classname, 0, $prefixLength) == $prefix) {
11-
$phpmailerPath = defined('PHPMAILER_PATH') && PHPMAILER_PATH != ''
11+
$phpmailerPath = defined('PHPMAILER_PATH') && is_dir(PHPMAILER_PATH)
1212
? rtrim(PHPMAILER_PATH, '/') . '/'
1313
: 'PHPMailer6/src/';
1414
$filename = $phpmailerPath . substr($classname, $prefixLength) . '.php';
@@ -33,7 +33,7 @@ public function __construct($exceptions)
3333
}
3434
}
3535
} else {
36-
if (defined('PHPMAILER_PATH') and PHPMAILER_PATH != '') {
36+
if (defined('PHPMAILER_PATH') && is_file(PHPMAILER_PATH)) {
3737
require_once PHPMAILER_PATH;
3838
} else {
3939
require_once __DIR__.'/PHPMailer/PHPMailerAutoload.php';

0 commit comments

Comments
 (0)