fixed unknowns="remove" to remove more strict (only variable names with letterns, numbers, underscore and dash), as it messes up json otherwise

This commit is contained in:
Ralf Becker 2011-06-02 13:30:21 +00:00
parent 423a1d9303
commit 8445199caf

View File

@ -349,10 +349,10 @@
case 'keep':
break;
case 'remove':
$str = preg_replace('/{[^ \t\r\n}]+}/', '', $str);
$str = preg_replace('/{[a-z0-9_-]+}/i', '', $str);
break;
case 'comment':
$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
$str = preg_replace('/{([a-z0-9_-]+)}/i', "<!-- Template $handle: Variable \\1 undefined -->", $str);
break;
}