httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: Showstopper!
Date Tue, 07 Aug 2001 03:32:20 GMT
On Mon, 6 Aug 2001, Ryan Bloom wrote:

> One of our QA guys at Covalent has just let me know that SSI's are
> broken in 2.0.  Basically, if, else, elif, and that family of SSI's
> don't seem to do what they are supposed to do.
>
> BTW, he caught these using the perl test-framework in httpd-test.
> The test cases he was using can be found in
> httpd-test/perl-framework/t/htdocs/modules/include/if*.shtml.
>
> All of these tests work correctly under Apache 1.3.
>
> For example:
>
> <!--#if expr="\"1\" = \"1\""-->
> pass
> <!--#endif -->
> <!--#if expr="\"1\" = \"2\""-->
> fail
> <!--#endif -->
>
> Doesn't work correctly.


I've found the problem.  ap_ssi_get_tag_and_value() is not correctly
re-null-terminating the string after it gets rid of the backslashes in the
expr.  So where it should be this:

"1" = "1"

it thinks it's this:

"1" = "1""1\"

Since these two are clearly not equal, the #if, #elif, #else tag
handlers themselves are actually doing the right thing.

If you change the files to look like this:

<!--#if expr="1 = 1"-->
pass
<!--#endif -->
<!--#if expr="1 = 2"-->
fail
<!--#endif -->

Then all the tests pass.

Patch on the way.

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message