httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 57448] New: SSI <!--#set --> cannot capture backreferences from regex match in <!--#if -->
Date Fri, 16 Jan 2015 00:27:33 GMT

            Bug ID: 57448
           Summary: SSI <!--#set --> cannot capture backreferences from
                    regex match in <!--#if -->
           Product: Apache httpd-2
           Version: 2.4.10
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_include

In Apache 2.2, one could set an SSI variable based on backreferences from a
regex match in the previous <!--#if -->:

<!--#if expr='$REQUEST_URI = /(.*)/' -->
<!--#set var="foo" value="$1" -->
Found <!--#echo var="foo" -->
<!--#endif -->

However, in Apache 2.4, the equivalent code doesn’t work:

<!--#if expr='v("REQUEST_URI") =~ /(.*)/' -->
<!--#set var="foo" value="$1" -->
Found <!--#echo var="foo" -->
<!--#endif -->

It sets the variable to the empty string and yields this error:

[Thu Jan 15 19:23:20.763133 2015] [include:warn] [pid 6768:tid 140695587436288]
[client] AH01330: regex capture $1 is out of range (last regex
was: '(null)') in /var/www/html/test.shtml

I can still use the Apache 2.2 code if I set SSILegacyExprParser on, but
obviously there should be a non-deprecated way to do this.

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message