mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-17 06:25:19 +02:00
- check if mb string functions available otherwise fallback to normal string functions
This commit is contained in:
@@ -38,7 +38,12 @@ function smarty_modifier_replace($string, $search, $replace)
|
||||
return $haystack;
|
||||
}
|
||||
}
|
||||
return mb_str_replace($search, $replace, $string);
|
||||
$smarty = Smarty::instance();
|
||||
if ($smarty->has_mb) {
|
||||
return mb_str_replace($search, $replace, $string);
|
||||
} else {
|
||||
return str_replace($search, $replace, $string);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user