Skip to content

Commit

Permalink
Merge pull request #1012 from kambereBr/handle-unicode-folder-name
Browse files Browse the repository at this point in the history
Handle Unicode in folder names
  • Loading branch information
marclaporte committed May 15, 2024
2 parents 054e60d + e692515 commit b5b4bd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/imap/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function format_imap_folder_section($folders, $id, $output_mod, $with_input = fa
if (strlen($output_mod->html_safe($folder['basename']))>15) {
$results .= '<a ' . $attrs .
' title="'.$output_mod->html_safe($folder['basename']).
'">'.substr($output_mod->html_safe($folder['basename']),0,15).'...</a>';
'">'.mb_substr($output_mod->html_safe($folder['basename']),0,15).'...</a>';
}
else {
$results .= '<a ' . $attrs. '>'.$output_mod->html_safe($folder['basename']).'</a>';
Expand Down Expand Up @@ -1217,7 +1217,7 @@ function prep_folder_name($imap, $folder, $decode_folder=false, $parent=false) {
if ($parent) {
$folder = sprintf('%s%s%s', $parent, $ns['delim'], $folder);
}
if ($folder && $ns['prefix'] && substr($folder, 0, strlen($ns['prefix'])) !== $ns['prefix']) {
if ($folder && $ns['prefix'] && mb_substr($folder, 0, strlen($ns['prefix'])) !== $ns['prefix']) {
$folder = sprintf('%s%s', $ns['prefix'], $folder);
}
return $folder;
Expand Down

0 comments on commit b5b4bd2

Please sign in to comment.