mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-05 12:14:12 +02:00
- bugfix when cascading some modifier like |strip|strip_tags modifier
This commit is contained in:
@@ -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]})";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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] . ')';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user