httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57448] New: SSI <!--#set --> cannot capture backreferences from regex match in <!--#if -->
Date Fri, 16 Jan 2015 00:27:33 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=57448

            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
          Assignee: bugs@httpd.apache.org
          Reporter: andersk@mit.edu

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 127.0.0.1:59575] 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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message