humanoidvani Posted March 11, 2014 Share Posted March 11, 2014 (edited) Hi, I had problem with Tools::ucwords($str) with czech mb string. When the $str = 'Jiří'; only 'Ji' is returned and causes error 500 in registration process. Prestashop ver 1.5.6.0, PHP ver 5.2.10 . Exceptions log file: *ERROR* Property Customer->firstname is not valid at line 837 in file classes/ObjectModel.php . Solution: Override Tools method ucwords like this (added encoding): class Tools extends ToolsCore { public static function ucwords($str, $encoding = 'utf-8') { if (function_exists('mb_convert_case')) return mb_convert_case($str, MB_CASE_TITLE, $encoding); return ucwords(strtolower($str)); } } . Original: public static function ucwords($str) { if (function_exists('mb_convert_case')) return mb_convert_case($str, MB_CASE_TITLE); return ucwords(strtolower($str)); } Tools.php Edited March 11, 2014 by humanoidvani (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts