diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-12-18 15:48:49 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-12-18 15:48:49 +0100 |
commit | 439d41b194073285ab97be94253b3f4cb4395e43 (patch) | |
tree | 272d4c64ea2d766235ecb41009117b5269f8cdfd /library/Smarty/libs/plugins/shared.mb_str_replace.php | |
parent | 08a8f195e749a120642f6c486c1dad62a73924d1 (diff) | |
download | volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.gz volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.bz2 volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.zip |
install smarty via composer and update other php libs
Diffstat (limited to 'library/Smarty/libs/plugins/shared.mb_str_replace.php')
-rw-r--r-- | library/Smarty/libs/plugins/shared.mb_str_replace.php | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/library/Smarty/libs/plugins/shared.mb_str_replace.php b/library/Smarty/libs/plugins/shared.mb_str_replace.php deleted file mode 100644 index a5682ed30..000000000 --- a/library/Smarty/libs/plugins/shared.mb_str_replace.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * Smarty shared plugin - * - * @package Smarty - * @subpackage PluginsShared - */ -if (!function_exists('smarty_mb_str_replace')) { - - /** - * Multibyte string replace - * - * @param string $search the string to be searched - * @param string $replace the replacement string - * @param string $subject the source string - * @param int &$count number of matches found - * - * @return string replaced string - * @author Rodney Rehm - */ - function smarty_mb_str_replace($search, $replace, $subject, &$count = 0) - { - if (!is_array($search) && is_array($replace)) { - return false; - } - if (is_array($subject)) { - // call mb_replace for each single string in $subject - foreach ($subject as &$string) { - $string = & smarty_mb_str_replace($search, $replace, $string, $c); - $count += $c; - } - } elseif (is_array($search)) { - if (!is_array($replace)) { - foreach ($search as &$string) { - $subject = smarty_mb_str_replace($string, $replace, $subject, $c); - $count += $c; - } - } else { - $n = max(count($search), count($replace)); - while ($n --) { - $subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c); - $count += $c; - next($search); - next($replace); - } - } - } else { - $parts = mb_split(preg_quote($search), $subject); - $count = count($parts) - 1; - $subject = implode($replace, $parts); - } - - return $subject; - } -} |