[interchange-bugs] [rt.icdevgroup.org #341] Parser eats up false values in tag body

Stefan Hornburg via RT interchange at rt.icdevgroup.org
Mon Aug 30 10:14:09 UTC 2010

Mon Aug 30 10:14:08 2010: Request 341 was acted upon.
Transaction: Ticket created by racke
       Queue: Interchange
     Subject: Parser eats up false values in tag body
       Owner: Nobody
  Requestors: racke at linuxia.de
      Status: new
 Ticket <URL: http://rt.icdevgroup.org/Ticket/Display.html?id=341 >

Hello, Interchange enthusiasts!

Today I stumbled on a weird problem, which turned out to be deficiency in the ITL parser.

Inside [perl] I had the following statement:

	$after = $Tag->filter({op => 'strip', body => $CGI->{"after_$sku"}});

To my surprise this yields an empty string if $CGI->{"after_$sku"} is zero.

The following statement works as expected:

	$after = $Tag->filter('strip', $CGI->{"after_$sku"});

This patch fixes the problem:

--- a/lib/Vend/Parse.pm
+++ b/lib/Vend/Parse.pm
@@ -482,7 +482,7 @@ sub resolve_args {
         @list = @{$ref}{@{$Order{$tag}}};
         push @list, $ref if defined $addAttr{$tag};
-       push @list, (shift || $ref->{body} || '') if $hasEndTag{$tag};
+       push @list, (shift || (defined $ref->{body} ? $ref->{body} : '')) if $hasEndTag{$tag};
         return @list;


LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

More information about the interchange-bugs mailing list