Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6, 4.7
-
Component/s: Core CiviCRM
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
The CRM_Utils_String::ellipsify() function is not multi-byte safe, and can therefore create database errors when truncating the strings in the middle of a multi-byte character.
Here is an example of such a message, happening with an online event registration:
INSERT INTO civicrm_participant (contact_id , event_id , status_id , role_id , register_date , source , fee_level , is_test , is_pay_later , fee_amount , discount_id , fee_currency ) VALUES ( 7552 , 256 , 5 , '1' , 20160622134255 , 'Registro de eventos on-line: Taller: \"Onboarding - Cómo integrar exitosamente a los nuevos talentos dentro de su organizaci�...' , ' No Asociados, IVA incluido - 1 ' , 0 , 1 , 766.00 , NULL , 'MXN' ) [nativecode=1366 ** Incorrect string value: '\xC3...' for column 'source' at row 1]
The word 'organización' has been wrongly ellipsified in the middle of the 'ó' multi-byte character, therefore creating an invalid UTF-8 code.