remove undefined variables, removes to much
Brought to you by:
nhruby,
richardarcher
Undefined variables are removed by this line in
template.inc:
$str = preg_replace('/{[^ \t\r\n}]+}/', "", $str);
this removes maybe CSS styles in the template file,
for example:
h1 {color:black}
would be removed or commented:
h1 <!-- Template $handle: Variable color:black
undefined -->
if tryed this, maybe you use it:
$str = preg_replace('/{[^ \t\r\n\:\;}]+}/', "", $str);
so : and ; wouldn't match the regular expression and
CSS or JavaScript Code between {} won't be removed.
Logged In: YES
user_id=279311
I'm of two minds about this one. But I think that it's best not to
risk breaking existing applications with this change.
There is a very simple work-around... add a space to your style
sheet or javascript. Template variable names cannot contain
spaces or tabs, and there is no reason why they cannot be added
to prevent deletion by template.