>Number: 2872 >Category: mod_include >Synopsis: (mod_include) $variable tests using regular expressions are >incorrect when including more than one test situation >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Wed Aug 19 02:00:01 PDT 1998 >Last-Modified: >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.3.1 (unix) >Environment: Linux unix.reachtheplanet.com 2.0.35 #2 Thu Jul 23 02:17:07 CDT 1998 i586 unknown RedHat 5.1 >Description: 1. what i'm trying to accomplish. 2. what i'm doing, specifically, to attempt to accomplish it. 3. the results i'm getting.
1. i'm trying to use server-side includes to build and maintain a navigation-button-bar that is included on pages within a webspace (done). the bar has buttons to directories in the webspace. when a user is viewing content in the "support" directory, for example, the "support" button will be a different, outstanding button than the other buttons. this is determined by using a conditional statement with mod_include to test what directory the user is in ($DOCUMENT_URI) against each directory/button name as the navigation bar is being built. if it matches, by regexp SSI-if-statement, the appropriate button will be displayed. 2. a standard html document within the webspace would contain an include statement that would call the source navbutton.html document. this document contains SSI which "builds" and "tests" each button within the navigation bar and then include it in the calling document. it will determine whether or not the button should be button.gif or button_over.gif, depending on whether or not the user is in the corresponding directory of the webspace. example; <!--#if expr="\"$DOCUMENT_URI\" >= \"/support/\"" --> the above example should test true if "/support/" is in "$DOCUMENT_URI" by regular expression match. therefore, including whatever follows, up until the next #ifel or #else statement. 3. the above example works. the problem that pops up is when one tries to use that statement again. when the code is used again, BOTH conditions are testing TRUE although only the second condition should be testing true. (i know this is confusing; see the code/url example) >How-To-Repeat: the following is the exact code i'm using: <!--begin support button build/test --> <!--#if expr="\"$DOCUMENT_URI\" >= \"/support/\"" --> tested true <!--#set var="navimg" value="support_over.gif" --> <!--#else --> <!--#set var="navimg" value="support.gif" --> <!--#endif --> <a href="/support"> <img src="/support/<!--#echo var="navimg" -->" width="100" height="25" name="support" border="0"></a><br> <!--end support button build/test --> <-- begin next button build/test --> .............. ........ and so on ... the first above example works if one is viewing documents in /support/* and this is the FIRST time the #if-condition has been used. if one views the SECOND button that has been tested... for example, "service", which would be in the /server/* webspace, BOTH condition one and condition two are testing TRUE. this is hard to understand/explain as well. see the following url for an example: http://www.reachtheplanet.com/test/navbar.html >Fix: i do not have knowledge or suggested ways to fix this issue. >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include <[EMAIL PROTECTED]> in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]
