Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#8 ESCAPE=0 ineffective when default_escape used

open
nobody
None
5
2006-11-28
2006-11-28
Bob Showalter
No

When default_escape is set, using ESCAPE=0 on a <TMPL_VAR> tag does not disable escaping, as the documentation implies that it should.

The problem seems to be that the regexes that parse the ESCAPE clause match the zero but do not capture it. The result is that specifying ESCAPE=0 is effectively the same as omitting the ESCAPE clause altogether.

Discussion

  • Logged In: NO

    Just tested for this bug with the following code, and found that it worked fine. Can you provide code that demonstrates this bug?

    --------------------------
    cat perl.pl
    #!/usr/bin/perl -w

    use HTML::Template ;

    my $t = HTML::Template->new('filename' => 'test.tmpl', 'default_escape' => 'url') ;

    $t->param('url' => 'http://www.houses.com/?bla=xyz&bla2=1') ;

    print $t->output ;

    ----------------------

    cat test.tmpl
    <tag>
    This is some text

    :<tmpl_var url>:

    :<tmpl_var url escape=0>:
    </tag>

    ----------------------------
    perl perl.pl
    <tag>
    This is some text

    :http%3A%2F%2Fwww.houses.com%2F%3Fbla%3Dxyz%26bla2%3D1:

    :http://www.houses.com/?bla=xyz&bla2=1:
    </tag>