From 307aac0acf61b3451536e95856ec008446299313 Mon Sep 17 00:00:00 2001 From: tschuettler Date: Fri, 9 Sep 2016 13:51:17 +0200 Subject: [PATCH] CRM-19335 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Mailing/Event/BAO/Bounce.php b/CRM/Mailing/Event/BAO/Bounce.php index fc050f48ce..d0e005a3c0 100644 --- a/CRM/Mailing/Event/BAO/Bounce.php +++ b/CRM/Mailing/Event/BAO/Bounce.php @@ -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(); -- 2.25.1