05-04-2020, 11:11 PM
Apply this change and let me know if it makes a difference
Code:
diff --git a/modules/Settings/MailScanner/core/MailScannerAction.php b/modules/Settings/MailScanner/core/MailScannerAction.php
index 10ce017d9..969e39fd7 100644
--- a/modules/Settings/MailScanner/core/MailScannerAction.php
+++ b/modules/Settings/MailScanner/core/MailScannerAction.php
@@ -67,6 +67,10 @@ class Vtiger_MailScannerAction {
}
}
+ public function cleanUTF8($value) {
+ return function_exists('iconv') ? @iconv('UTF-8', 'UTF-8//IGNORE', $value) : $value;
+ }
+
/**
* Create/Update the information of Action into database.
*/
@@ -238,8 +242,8 @@ class Vtiger_MailScannerAction {
public function __CreateTicket($mailscanner, $mailrecord) {
global $adb;
// Prepare data to create trouble ticket
- $usetitle = $mailrecord->_subject;
- $description = $mailrecord->getBodyText();
+ $usetitle = $this->cleanUTF8($mailrecord->_subject);
+ $description = $this->cleanUTF8($mailrecord->getBodyText());
// There will be only on FROM address to email, so pick the first one
$fromemail = $mailrecord->_from[0];
@@ -338,9 +342,9 @@ class Vtiger_MailScannerAction {
$focus->column_fields['parent_type'] = $module;
$focus->column_fields['activitytype'] = 'Emails';
$focus->column_fields['parent_id'] = "$linkfocus->id@$relid|";
- $focus->column_fields['subject'] = $mailrecord->_subject;
+ $focus->column_fields['subject'] = $this->cleanUTF8($mailrecord->_subject);
- $focus->column_fields['description'] = $mailrecord->getBodyHTML();
+ $focus->column_fields['description'] = $this->cleanUTF8($mailrecord->getBodyHTML());
$focus->column_fields['assigned_user_id'] = $linkfocus->column_fields['assigned_user_id'];
$focus->column_fields['date_start'] = date('Y-m-d', $mailrecord->_date);
$focus->column_fields['email_flag'] = 'MAILSCANNER';
Joe
TSolucio
TSolucio