Skip Menu |

This queue is for tickets about the CGI-SSI CPAN distribution.

Report information
The Basics
Id: 19025
Status: resolved
Worked: 10 min
Priority: 0/
Queue: CGI-SSI

People
Owner: james [...] bitperfect.com
Requestors: jarich [...] perltraining.com.au
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.88
Fixed in: (no value)



Subject: Errors in handling nested if statements
In the attached file, the nested if statement isn't handled correctly. Instead of skipping straight on to the section for newer browsers, we instead get all the HTML from "About Somewhere" onwards. Strangely, we don't get any errors for the subsequent else, or endif. The later if-else-endif appears to work as expected. If I get time, I'll try to make a failing test for this case, but that might be a month away. Thankyou for your work on this module, it's made my life much easier. Oh, and another (but tiny) bug... in your _include_virtual you write "atfile" in one place where I presume you mean "catfile". Jacinta
Subject: test.shtml
From: clee [...] genmeta.com
I wasn't the one who created the original ticket, but I have encountered the same problem. Here's an example that illustrates this: INPUT: ------------------------------------------------------------ <!--#set var="OUTER" value="0" --> <!--#set var="INNER" value="1" --> <!--#if expr="$OUTER" --> <!--#if expr="$INNER" --> foo <!--#endif --> bar <!--#else --> baz <!--#endif --> ------------------------------------------------------------ OUTPUT: ------------------------------------------------------------ bar baz ------------------------------------------------------------ Attached is a patch to fix this. The patch also fixes the typo for 'atfile'. Hope that helps, Cliff
264c264 < $file = atfile($FindBin::Bin,$file); --- > $file = catfile($FindBin::Bin,$file); 545d544 < $self->_leaving_if(); 546a546,547 > $self->_leaving_if(); > $self->_resume() if (!$self->_in_if);
Thanks for this. Sorry it took me a while to respond - I didn't get an email about this message for some reason. Anyway, it's fixed in the latest release, and your test script below works properly in the latest release. James On Wed Feb 14 18:33:20 2007, clee wrote: Show quoted text
> I wasn't the one who created the original ticket, but I have encountered > the same problem. Here's an example that illustrates this: > > INPUT: > ------------------------------------------------------------ > <!--#set var="OUTER" value="0" --> > <!--#set var="INNER" value="1" --> > <!--#if expr="$OUTER" --> > <!--#if expr="$INNER" --> > foo > <!--#endif --> > bar > <!--#else --> > baz > <!--#endif --> > ------------------------------------------------------------ > > OUTPUT: > ------------------------------------------------------------ > > > > bar > > baz > > ------------------------------------------------------------ > > Attached is a patch to fix this. The patch also fixes the typo for
'atfile'. Show quoted text
> > Hope that helps, > Cliff