Replace invalid characters in bounce reason with unicode replacement character
authorThomas Schüttler <tschuettler@oxfam.de>
Fri, 4 Jan 2019 10:57:27 +0000 (11:57 +0100)
committerThomas Schüttler <tschuettler@oxfam.de>
Fri, 4 Jan 2019 10:57:27 +0000 (11:57 +0100)
CRM/Mailing/Event/BAO/Bounce.php

index 068693fdaf2a091f77e86164dc6b203c17e9628a..a3f5af0062ab46bdcba1164105757ce3971a29fd 100644 (file)
@@ -77,6 +77,9 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
       }
     }
 
+    // replace any invalid unicode characters with replacement characters
+    $params['bounce_reason'] = mb_convert_encoding($params['bounce_reason'], 'UTF-8', 'UTF-8');
+
     // CRM-11989
     $params['bounce_reason'] = mb_strcut($params['bounce_reason'], 0, 254);