Received: (qmail 61562 invoked by uid 501); 16 Feb 2001 20:50:22 -0000 Message-Id: <20010216205022.61558.qmail@apache.org> Date: 16 Feb 2001 20:50:22 -0000 From: Buddy Lucas Reply-To: buddy@wildape.com To: submit@bugz.apache.org Subject: mod_rewrite does not expand variables of type ${map:key} properly X-Send-Pr-Version: 3.110 >Number: 7259 >Category: mod_rewrite >Synopsis: mod_rewrite does not expand variables of type ${map:key} properly >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: duplicate >Submitter-Id: apache >Arrival-Date: Fri Feb 16 13:00:02 PST 2001 >Closed-Date: Fri Feb 16 20:34:51 PST 2001 >Last-Modified: Fri Feb 16 20:34:51 PST 2001 >Originator: buddy@wildape.com >Release: 1.3.17 >Organization: >Environment: Linux {myhost} 2.2.15-4mdk #1 Wed May 10 15:31:30 CEST 2000 i686 unknown >Description: This bug disables using map expansion in mod_rewrite (e.g., in RewriteCond, RewriteRule etc.). The expression that should have been substituted is returned as part of the uri. The reason for this can be found in find_char_in_brackets(), which doesn't count the brackets correctly. >How-To-Repeat: RewriteMap mymap txt:/home/httpd/maps/mymap.txt RewriteCond ${mymap:%{HTTP_HOST}} !^root$ RewriteRule ^(.*) http://${mymap:%{HTTP_HOST}}$1 [R=301] >Fix: Small patch for me, but a large fix for mankind. ;-) --- mod_rewrite.c.orig Fri Feb 16 19:37:28 2001 +++ mod_rewrite.c Fri Feb 16 21:31:20 2001 @@ -4193,7 +4193,7 @@ { int depth; - for (depth = 1; *s; ++s) { + for (depth = 0; *s; ++s) { if (*s == c && depth == 1) { return s; } >Release-Note: >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: slive State-Changed-When: Fri Feb 16 20:34:51 PST 2001 State-Changed-Why: This is a known bug which will be fixed in the next release. Thanks for using Apache! Class-Changed-From-To: sw-bug-duplicate Class-Changed-By: slive Class-Changed-When: Fri Feb 16 20:34:51 PST 2001 >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database 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! ]