Skip to content

Commit

Permalink
Use PHPMAILER_PATH only when it appears to be valid. For PHPMailer 5 …
Browse files Browse the repository at this point in the history
…it should be a file and for PHPMailer 6 it should be a directory.
  • Loading branch information
bramley authored and marianaballa committed Nov 11, 2020
1 parent 68a3758 commit fb7013f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public_html/lists/admin/class.phplistmailerbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function ($classname)
$prefixLength = strlen($prefix);

if (substr($classname, 0, $prefixLength) == $prefix) {
$phpmailerPath = defined('PHPMAILER_PATH') && PHPMAILER_PATH != ''
$phpmailerPath = defined('PHPMAILER_PATH') && is_dir(PHPMAILER_PATH)
? rtrim(PHPMAILER_PATH, '/') . '/'
: 'PHPMailer6/src/';
$filename = $phpmailerPath . substr($classname, $prefixLength) . '.php';
Expand All @@ -33,7 +33,7 @@ public function __construct($exceptions)
}
}
} else {
if (defined('PHPMAILER_PATH') and PHPMAILER_PATH != '') {
if (defined('PHPMAILER_PATH') && is_file(PHPMAILER_PATH)) {
require_once PHPMAILER_PATH;
} else {
require_once __DIR__.'/PHPMailer/PHPMailerAutoload.php';
Expand Down

0 comments on commit fb7013f

Please sign in to comment.