From 7085a0c2f7104a56a7e946c43ba0b5736be5f4e7 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 27 Dec 2016 14:47:01 +0100 Subject: * smarty bundled --- lib/smarty3/plugins/modifier.replace.php | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/smarty3/plugins/modifier.replace.php (limited to 'lib/smarty3/plugins/modifier.replace.php') diff --git a/lib/smarty3/plugins/modifier.replace.php b/lib/smarty3/plugins/modifier.replace.php new file mode 100644 index 0000000..aa5e857 --- /dev/null +++ b/lib/smarty3/plugins/modifier.replace.php @@ -0,0 +1,34 @@ + + * Name: replace
+ * Purpose: simple search/replace + * + * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) + * @author Monte Ohrt + * @author Uwe Tews + * + * @param string $string input string + * @param string $search text to search for + * @param string $replace replacement text + * + * @return string + */ +function smarty_modifier_replace($string, $search, $replace) +{ + if (Smarty::$_MBSTRING) { + require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + + return smarty_mb_str_replace($search, $replace, $string); + } + + return str_replace($search, $replace, $string); +} -- cgit v1.2.3