definite bug (ESCAPE=URL/JS and DEFAULT)

Benjamin Warfield <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
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!



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.