Open Seb-C opened 7 years ago
That code will fail if mbstring isn't loaded. Ideally, this should use \Str::truncate(), which is multibyte aware.
I think this needs to be looked at in more broader terms, quite a bit of the Fuel was written when overloading string functions was the norm, which isn't the case anymore, and is even deprecated as of PHP 7.2.
This replaces
substr
bymb_substr
.My specific case happened with a
varchar(250)
field, and a string that was longer. The 250th and 251th bytes of the string were an UTF-8 non-breakable space (0xC2A0).Since C2 is a control character that can't exist alone, this made everything using this string crash thereafter (including debugging tools).