- bugfix when cascading some modifier like |strip|strip_tags modifier

This commit is contained in:
Uwe.Tews
2010-08-06 13:43:52 +00:00
parent 09dfffd2a0
commit cf231447d2
4 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ function smarty_modifiercompiler_strip($params, $compiler)
if (!isset($params[1])) {
$params[1] = "' '";
}
return 'preg_replace(\'!\s+!\',' . $params[1] . ',' . $params[0] . ')';
return "preg_replace('!\s+!', {$params[1]},{$params[0]})";
}
?>
+2 -2
View File
@@ -20,11 +20,11 @@
*/
function smarty_modifiercompiler_strip_tags($params, $compiler)
{
if (!isset($params[1])) {
if (!isset($params[1])) {
$params[1] = true;
}
if ($params[1] === true) {
return 'preg_replace(\'!<[^>]*?>!\', \' \', ' . $params[0] . ')';
return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";
} else {
return 'strip_tags(' . $params[0] . ')';
}