CRM-19335
authortschuettler <tschuettler@oxfam.de>
Fri, 9 Sep 2016 11:51:17 +0000 (13:51 +0200)
committerGitHub <noreply@github.com>
Fri, 9 Sep 2016 11:51:17 +0000 (13:51 +0200)
This creates a multibyte aware substring.
Since we are using MySQL >= 5 we could also use mb_substr($params['bounce_reason'], 0, 255) to fully use that varchar(255).

CRM/Mailing/Event/BAO/Bounce.php

index fc050f48ce88c3e93596cdc9fd7ab6f81e27a7c7..d0e005a3c07317d6dc69f4cb2bec96532b6e2549 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce {
     }
 
     // CRM-11989
-    $params['bounce_reason'] = substr($params['bounce_reason'], 0, 254);
+    $params['bounce_reason'] = mb_strcut($params['bounce_reason'], 0, 254);
 
     $bounce->copyValues($params);
     $bounce->save();