[htmltmpl] definite bug (ESCAPE=URL/JS and DEFAULT)
Brought to you by:
samtregar
From: Benjamin W. <war...@sb...> - 2006-01-26 04:38:06
|
I ran into this one the other day and thought I'd made a horrendous typo in my template. No such luck, though. If a default value is specified for a variable with URL or JS escaping, the default is always printed (along with any value supplied by param()), and the escaping doesn't happen. Example attached, unfortunately with nothing approaching a patch to fix it. Seems to be broken in both 2.7 and 2.8, under perls 5.6.1 and 5.8.7 (though I admit I didn't fill that matrix out completely). --Ben Warfield #!/usr/local/bin/perl -l use HTML::Template; $text = q{We're number <TMPL_VAR NAME="num" DEFAULT="one" ESCAPE="URL">!}; $t = HTML::Template->new(scalarref=>\$text); $t->param(num=>'two and 1/2'); print $t->output; __END__ We're number onetwo and 1/2! |