Add cid default domain

This commit is contained in:
Mariusz Krzaczkowski 2024-03-15 17:27:41 +01:00 committed by Marcus Bointon
parent 5acdb20adf
commit 9a5f46f747
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24
1 changed files with 9 additions and 2 deletions

View File

@ -590,6 +590,13 @@ class PHPMailer
*/
public static $validator = 'php';
/**
* cid default domain
*
* @var string
*/
public $cid_default_domain = '@phpmailer.0';
/**
* An instance of the SMTP sender class.
*
@ -4625,7 +4632,7 @@ class PHPMailer
}
//Hash the decoded data, not the URL, so that the same data-URI image used in multiple places
//will only be embedded once, even if it used a different encoding
$cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; //RFC2392 S 2
$cid = substr(hash('sha256', $data), 0, 32) . $this->cid_default_domain; //RFC2392 S 2
if (!$this->cidExists($cid)) {
$this->addStringEmbeddedImage(
@ -4659,7 +4666,7 @@ class PHPMailer
$directory = '';
}
//RFC2392 S 2
$cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0';
$cid = substr(hash('sha256', $url), 0, 32) . $this->cid_default_domain;
if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) {
$basedir .= '/';
}