- check if mb string functions available otherwise fallback to normal string functions

This commit is contained in:
Uwe.Tews
2009-04-10 15:52:59 +00:00
parent 1262b7d873
commit ba61f12384
12 changed files with 224 additions and 150 deletions

View File

@@ -72,7 +72,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null)
case 'mail':
// safe way to display e-mail address on a web page
return mb_str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
if ($smarty->has_mb) {
return mb_str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
} else {
return str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
}
case 'nonstd':
// escape non-standard chars, such as ms document quotes