Received: (qmail 98138 invoked by uid 501); 6 Nov 2000 17:54:43 -0000 Message-Id: <20001106175443.98137.qmail@locus.apache.org> Date: 6 Nov 2000 17:54:43 -0000 From: Tony Holmes Reply-To: tony@crosswinds.net To: submit@bugz.apache.org Subject: Conditional Backreferences in RewriteMaps used in RewriteCond does not work X-Send-Pr-Version: 3.110 >Number: 6802 >Category: mod_rewrite >Synopsis: Conditional Backreferences in RewriteMaps used in RewriteCond does not work >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Mon Nov 06 10:10:04 PST 2000 >Closed-Date: Wed Nov 08 10:30:30 PST 2000 >Last-Modified: Wed Nov 08 10:30:30 PST 2000 >Originator: tony@crosswinds.net >Release: 1.3.14 >Organization: >Environment: FreeBSD db.crosswinds.net 3.4-STABLE FreeBSD 3.4-STABLE #0: Fri Mar 10 16:34:46 EST 2000 gcc version 2.7.2.3 Apache 1.3.14 + mod_rewrite fix diff >Description: When using a Condition backreference as a key to a dbm RewriteMap, used in a RewriteCond statement, the % is not expanded correctly. This still exists with the mod_rewrite patch fix for 1.3.14 >How-To-Repeat: Using a DBM rewrite map named foo, here is the httpd.conf lines RewriteCond %{REQUEST_FILENAME} /[~|%7E]([a-z0-9]*)/$ [NC] RewriteCond %{foo:%1} !NO RewriteRule ^/(.*)$ /someotherurl/$1 [L] The foo map lookup fails since %1 is passed as tthe key instead of the value of the conditional backreference >Fix: >Release-Note: >Audit-Trail: From: Tony Finch To: Tony Holmes Cc: apbugs@apache.org Subject: Re: mod_rewrite/6802: Conditional Backreferences in RewriteMaps used in RewriteCond does not work Date: Tue, 7 Nov 2000 01:58:31 +0000 Tony Holmes wrote: > >When using a Condition backreference as a key to a dbm RewriteMap, used in a >RewriteCond statement, the % is not expanded correctly. > >This still exists with the mod_rewrite patch fix for 1.3.14 > >Using a DBM rewrite map named foo, here is the httpd.conf lines > >RewriteCond %{REQUEST_FILENAME} /[~|%7E]([a-z0-9]*)/$ [NC] >RewriteCond %{foo:%1} !NO >RewriteRule ^/(.*)$ /someotherurl/$1 [L] > >The foo map lookup fails since %1 is passed as tthe key instead of the >value of the conditional backreference Er, but the syntax for a map lookup is ${map:key} not %{}. Tony. -- en oeccget g mtcaa f.a.n.finch v spdlkishrhtewe y dot@dotat.at eatp o v eiti i d. fanf@covalent.net From: Tony Holmes To: Tony Finch Cc: apbugs@apache.org Subject: Re: mod_rewrite/6802: Conditional Backreferences in RewriteMaps used in RewriteCond does not work Date: Tue, 7 Nov 2000 09:50:49 -0500 On +Nov 07, Tony Finch wrote: > Tony Holmes wrote: > > > >When using a Condition backreference as a key to a dbm RewriteMap, used in a > >RewriteCond statement, the % is not expanded correctly. > > > >This still exists with the mod_rewrite patch fix for 1.3.14 > > > >Using a DBM rewrite map named foo, here is the httpd.conf lines > > > >RewriteCond %{REQUEST_FILENAME} /[~|%7E]([a-z0-9]*)/$ [NC] > >RewriteCond %{foo:%1} !NO > >RewriteRule ^/(.*)$ /someotherurl/$1 [L] > > > >The foo map lookup fails since %1 is passed as tthe key instead of the > >value of the conditional backreference > > Er, but the syntax for a map lookup is ${map:key} not %{}. Sorry for the dup, missed the apbugs cc. That was a typo, in my copying of the test. It should be: RewriteCond ${foo:%1} !NO The problem does exist with proper syntax (I lacked cut'n'paste). -- Tony Holmes Senior Systems Architect Crosswinds Internet Communications Inc. State-Changed-From-To: open-closed State-Changed-By: fanf State-Changed-When: Wed Nov 8 10:30:25 PST 2000 State-Changed-Why: Problem solved. Thanks for using Apache! >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! ]