Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

+23
View File
@@ -290,6 +290,13 @@ class _Email
{
$this->to = array( $headers['to'] );
}
/* We need to account for formats like "Doe, John (Contractor)" <a@b.com>, "Doe, Jane" <z@b.com> */
elseif( mb_strpos( $headers['to'], '"' ) !== FALSE )
{
/* The regex here is looking for opening quote, anything except <, comma, anything, closing quote and then stripping the comma so that
commas are only used to separate the actual addresses */
$this->to = explode( ',', preg_replace( "/\"([^<]*?),(.*?)\"/", "\"$1 $2\"", $headers['to'] ) );
}
else
{
$this->to = explode( ',', $headers['to'] );
@@ -310,6 +317,13 @@ class _Email
{
$this->cc = $headers['cc'];
}
/* We need to account for formats like "Doe, John (Contractor)" <a@b.com>, "Doe, Jane" <z@b.com> */
elseif( mb_strpos( $headers['cc'], '"' ) !== FALSE )
{
/* The regex here is looking for opening quote, anything except <, comma, anything, closing quote and then stripping the comma so that
commas are only used to separate the actual addresses */
$this->cc = explode( ',', preg_replace( "/\"([^<]*?),(.*?)\"/", "\"$1 $2\"", $headers['cc'] ) );
}
else
{
$this->cc = explode( ",", $headers['cc'] );
@@ -540,6 +554,15 @@ class _Email
{
$exploded = explode( '<br>', $body );
}
/* It is possible the email is formatted with <p></p> and not <br> which can confuse the quote selection */
if ( mb_stristr( $body, '</p>' ) or mb_stristr( $body, '</div>' ) )
{
$body = preg_replace( '#<(p|div)[^>]*?>#', '', $body );
$body = preg_replace( '#</(p|div)>#', '<br>', $body );
$exploded = explode( '<br>', $body );
}
foreach ( $exploded as $k => $line )
{
$line = trim( $line );