mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-25 20:36:01 +03:00
Check to see if message is already encoded in utf8
Adding requirement to if statement to check if message matches UTF-8 encoding via regex. This will prevent encoding errors when converting UTF-8 to UTF-8.
This commit is contained in:
parent
8e742ef80e
commit
04b5a5ed33
@ -437,7 +437,7 @@ class Message
|
||||
|
||||
$messageBody = self::decode($messageBody, $structure->encoding);
|
||||
|
||||
if (!empty($parameters['charset']) && $parameters['charset'] !== self::$charset)
|
||||
if (!empty($parameters['charset']) && !preg_match('/utf-?8/i', $parameters['charset']) && $parameters['charset'] !== self::$charset)
|
||||
$messageBody = iconv($parameters['charset'], self::$charset, $messageBody);
|
||||
|
||||
if (strtolower($structure->subtype) === 'plain' || ($structure->type == 1 && strtolower($structure->subtype) !== 'alternative')) {
|
||||
|
Loading…
Reference in New Issue
Block a user