use lib './blib/lib';
use lib './blib/arch';
use DTL::Fast;
my $x = 0;
my $z = \&DTL::Fast::html_protect;
*DTL::Fast::html_protect = sub {
$x++;
goto &$z;
};
my $tpl = DTL::Fast::Template->new('Hello, {{ username }}!');
warn $tpl->render({ username => '<xmp>Hello world</xmp>' }); # ok
warn $x; # 1
###
my $tpl = DTL::Fast::Template->new('Hello, {{ foo|default:username }}!');
warn $tpl->render({ foo => undef, username => '<xmp>Hello world</xmp>' }); # not ok
warn $x; # must be 2, but it's 3
###
my $tpl = DTL::Fast::Template->new('Hello, {{ foo|default_if_none:username }}!');
warn $tpl->render({ foo => undef, username => '<xmp>Hello world</xmp>' }); # not ok
warn $x; # 5
Seems like we need to make some fixes at lib/DTL/Fast/Variable.pm
Seems like we need to make some fixes at
lib/DTL/Fast/Variable.pm