- fixed variables in 'file' attribute of {extend} tag

- fixed problems in modifiers (if mb string functions not present)
This commit is contained in:
Uwe.Tews
2009-04-11 08:47:28 +00:00
parent ba61f12384
commit c9b789ca32
7 changed files with 13 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ function smarty_modifier_regex_replace($string, $search, $replace)
if ($smarty->has_mb) {
return mb_ereg_replace($search, $replace, $string);
} else {
return ereg_replace($search, $replace, $string);
return preg_replace($search, $replace, $string);
}
}
@@ -52,7 +52,7 @@ function _smarty_regex_replace_check($search)
$search = substr($search, 0, $pos);
if (mb_preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
/* remove eval-modifier from $search */
$search = substr($search, 0, - strlen($match[1])) . ereg_replace('![e\s]+!', '', $match[1]);
$search = substr($search, 0, - strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
}
}
return $search;