httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48351] New: Ampersand taken to mean "what is matched by the previous regex" - unexpected given the "perl color" of regexes
Date Tue, 08 Dec 2009 20:08:38 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48351

           Summary: Ampersand taken to mean "what is matched by the
                    previous regex" - unexpected given the "perl color" of
                    regexes
           Product: Apache httpd-2
           Version: 2.0.54
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: fgaliegue@gmail.com


If we take this sample:

RedirectMatch permanent ^/foo/?$
http://some.external.site/?var1=val1&var2=val2&var3=val3

and the URL entered is:

http://first.site/foo/

the redirect is to:

http://some.external.site/?var1=val1/foo/var2=val2/foo/var3=val3

Therefore, the & has extended to the whole text matched by the "left" regex,
just like it does with "classic dialect" regex engines such as sed and vi.
The same behavior has been observed with SetEnvIf and RewrireRule. Probably
other modules are affected as well.

This comes as quite a surprise given that Apache uses PCRE. I'd have expected
$& to work, but not a plain ampersand.

This is true of Apache 2.0.54 and also 2.2.9, installed by default on
Centos/RHEL 4.x and 5.x respectively. But this also holds true for the Apache
2.2.x coming with the latest Debian (I don't remember the exact version) and
Apache 2.2.14 on Gentoo.

For coherency, I'd say that $& should replace & for this purpose, to be more
inline with perl's regexes. But then it seems that Apache has behaved this way
for quite a while (since 2.0.x times at least, I don't know for 1.3) and this
change could break some setups...

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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