Redbean + Smarty update

This commit is contained in:
Robin Kloppe 2014-10-13 11:24:53 +02:00
parent c1b8226466
commit eb0835ff74
122 changed files with 12653 additions and 11637 deletions

View file

@ -2,7 +2,7 @@
/**
* Smarty shared plugin
*
* @package Smarty
* @package Smarty
* @subpackage PluginsShared
*/
if (!function_exists('smarty_mb_str_replace')) {
@ -14,10 +14,11 @@ if (!function_exists('smarty_mb_str_replace')) {
* @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);
@ -51,5 +52,4 @@ if (!function_exists('smarty_mb_str_replace')) {
return $subject;
}
}