From: tschuettler Date: Fri, 9 Sep 2016 11:51:17 +0000 (+0200) Subject: CRM-19335 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=307aac0acf61b3451536e95856ec008446299313;p=civicrm-core.git 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). --- 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();