Commit c8a758a4850e2a0da28f5f7dfeede9d53322c522

Authored by Jonathan Byrne
1 parent b1d2af4b

KTS-2251

"Characters in the names of Folders and files appear as question marks and squares in the crumbtrail."

Fixed
Question marks are no longer displayed on truncated bread crumb details.

Committed By: Jonathan Byrne
Reviewed By: Jalaloedien Abrahams

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7411 c91229c3-7414-0410-bfa2-8a42b809f60b
thirdparty/Smarty/plugins/modifier.mb_truncate.php
... ... @@ -26,12 +26,14 @@ function smarty_modifier_mb_truncate($string, $length = 80, $etc = '...',
26 26 if ($length == 0)
27 27 return '';
28 28  
29   - if (mb_strlen($string) > $length) {
30   - $length -= mb_strlen($etc);
  29 + if (mb_strlen($string, 'UTF-8') > $length) {
  30 + mb_internal_encoding("UTF-8");
  31 +
31 32 if (!$break_words)
32 33 $string = preg_replace('/\s+?(\S+)?$/', '', mb_substr($string, 0, $length+1));
33 34  
34   - return mb_substr($string, 0, $length).$etc;
  35 + return html_entity_decode(mb_substr($string, 0, $length, 'UTF-8').$etc, ENT_NOQUOTES, 'UTF-8');
  36 +
35 37 } else
36 38 return $string;
37 39 }
... ...