mehran Posted December 29, 2016 Share Posted December 29, 2016 Hello We have problem with name products and some not show name the last VPS we have not problem but new vps we have problem Php v is 5.5 I try resolve but I did not succeed: {$product.name|truncate:45:'...'|escape:'html':'UTF-8'} truncate chane to 100 but not resolve plz help me Link to comment Share on other sites More sharing options...
mehran Posted December 30, 2016 Author Share Posted December 30, 2016 plz help me Link to comment Share on other sites More sharing options...
mehran Posted December 31, 2016 Author Share Posted December 31, 2016 (edited) I finaly see this code problem with some characters: /classes/Tools.php line 1556 public static function truncate($str, $max_length, $suffix = '...') { if (Tools::strlen($str) <= $max_length) { return $str; } $str = utf8_decode($str); return (utf8_encode(substr($str, 0, $max_length - Tools::strlen($suffix)).$suffix)); } this code does not work correctly For example 141 no problem but 14.1 or 12*12 has problem but 1212 no problem My php is 5.5.3 this is a bug? Edited December 31, 2016 by mehran (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now