aboutsummaryrefslogtreecommitdiffstats
path: root/library/Smarty/libs/plugins/shared.mb_str_replace.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-12-12 00:28:46 -0800
committerfriendica <info@friendica.com>2014-12-12 00:28:46 -0800
commitb30ea4c2c51f893bf0cffbea38e875cb01c6c431 (patch)
tree07c6f125256c73bfa29fe2dfed0f601def167adc /library/Smarty/libs/plugins/shared.mb_str_replace.php
parentd3465802d6433bcd4cf24971951e0633161b0665 (diff)
parent967ab871b836f618107fe144978bd1453c3c6634 (diff)
downloadvolse-hubzilla-b30ea4c2c51f893bf0cffbea38e875cb01c6c431.tar.gz
volse-hubzilla-b30ea4c2c51f893bf0cffbea38e875cb01c6c431.tar.bz2
volse-hubzilla-b30ea4c2c51f893bf0cffbea38e875cb01c6c431.zip
Merge https://github.com/friendica/red into pending_merge
Diffstat (limited to 'library/Smarty/libs/plugins/shared.mb_str_replace.php')
-rw-r--r--library/Smarty/libs/plugins/shared.mb_str_replace.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/library/Smarty/libs/plugins/shared.mb_str_replace.php b/library/Smarty/libs/plugins/shared.mb_str_replace.php
index ecafeb74a..a5682ed30 100644
--- a/library/Smarty/libs/plugins/shared.mb_str_replace.php
+++ b/library/Smarty/libs/plugins/shared.mb_str_replace.php
@@ -2,7 +2,7 @@
/**
* Smarty shared plugin
*
- * @package Smarty
+ * @package Smarty
* @subpackage PluginsShared
*/
if (!function_exists('smarty_mb_str_replace')) {
@@ -10,14 +10,15 @@ 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
+ * @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)
+ function smarty_mb_str_replace($search, $replace, $subject, &$count = 0)
{
if (!is_array($search) && is_array($replace)) {
return false;
@@ -25,7 +26,7 @@ if (!function_exists('smarty_mb_str_replace')) {
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);
+ $string = & smarty_mb_str_replace($search, $replace, $string, $c);
$count += $c;
}
} elseif (is_array($search)) {
@@ -36,7 +37,7 @@ if (!function_exists('smarty_mb_str_replace')) {
}
} else {
$n = max(count($search), count($replace));
- while ($n--) {
+ while ($n --) {
$subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);
$count += $c;
next($search);
@@ -48,8 +49,7 @@ if (!function_exists('smarty_mb_str_replace')) {
$count = count($parts) - 1;
$subject = implode($replace, $parts);
}
+
return $subject;
}
-
}
-?> \ No newline at end of file