httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r960233 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_rewrite.html.en docs/manual/mod/mod_rewrite.xml docs/manual/rewrite/flags.html.en docs/manual/rewrite/flags.xml modules/mappers/mod_rewrite.c
Date Sat, 03 Jul 2010 16:21:58 GMT
Author: rjung
Date: Sat Jul  3 16:21:58 2010
New Revision: 960233

URL: http://svn.apache.org/viewvc?rev=960233&view=rev
Log:
Allow to set environment variables using mod_rewrite without
explicitely giving a value.

Most modules only check presence of a variable, not the
value, so it makes sense to make the VAL argument in
the mod_rewrite ENV flag optional.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
    httpd/httpd/trunk/docs/manual/rewrite/flags.html.en
    httpd/httpd/trunk/docs/manual/rewrite/flags.xml
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=960233&r1=960232&r2=960233&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Jul  3 16:21:58 2010
@@ -13,6 +13,9 @@ Changes with Apache 2.3.7
 
   *) Fix Windows build when using VC6. [Gregg L. Smith <lists glewis com>]
 
+  *) mod_rewrite: Allow to set environment variables without explicitely
+     giving a value. [Rainer Jung]
+
 Changes with Apache 2.3.6
 
   *) SECURITY: CVE-2009-3555 (cve.mitre.org)

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en?rev=960233&r1=960232&r2=960233&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.html.en Sat Jul  3 16:21:58 2010
@@ -920,9 +920,9 @@ cannot use <code>$N</code> in the substi
         ...</a></em></td>
     </tr>
     <tr>
-        <td>env|E=<em>VAR</em>:<em>VAL</em></td>
-        <td>Causes an environment variable <em>VAR</em> to be set to the
-        value <em>VAL</em>. <em><a href="../rewrite/flags.html#flag_e">details
...</a></em></td>
+        <td>env|E=<em>VAR</em>[:<em>VAL</em>]</td>
+        <td>Causes an environment variable <em>VAR</em> to be set (to the
+        value <em>VAL</em> if provided). <em><a href="../rewrite/flags.html#flag_e">details
...</a></em></td>
     </tr>
     <tr>
         <td>forbidden|F</td>

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?rev=960233&r1=960232&r2=960233&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Sat Jul  3 16:21:58 2010
@@ -928,9 +928,9 @@ cannot use <code>$N</code> in the substi
         ...</a></em></td>
     </tr>
     <tr>
-        <td>env|E=<em>VAR</em>:<em>VAL</em></td>
-        <td>Causes an environment variable <em>VAR</em> to be set to the
-        value <em>VAL</em>. <em><a
+        <td>env|E=<em>VAR</em>[:<em>VAL</em>]</td>
+        <td>Causes an environment variable <em>VAR</em> to be set (to the
+        value <em>VAL</em> if provided). <em><a
         href="../rewrite/flags.html#flag_e">details ...</a></em></td>
     </tr>
     <tr>

Modified: httpd/httpd/trunk/docs/manual/rewrite/flags.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/flags.html.en?rev=960233&r1=960232&r2=960233&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/flags.html.en (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/flags.html.en Sat Jul  3 16:21:58 2010
@@ -210,7 +210,7 @@ is run, thus unsetting what you have set
 Environment Variables document</a> for more details on how Environment
 variables work.</p>
 
-<p>The syntax for this flag is:</p>
+<p>The full syntax for this flag is:</p>
 
 <div class="example"><p><code>
 [E=VAR:VAL]
@@ -219,7 +219,16 @@ variables work.</p>
 <p><code>VAL</code> may contain backreferences (<code>$N</code>
or
 <code>%N</code>) which will be expanded.</p>
 
-<p>These environment variables can then be used in a variety of
+<p>Using the short form</p>
+
+<div class="example"><p><code>
+[E=VAR]
+</code></p></div>
+
+<p>you can set the environment variable named <code>VAR</code> to an
+empty value.</p>
+
+<p>Environment variables can then be used in a variety of
 contexts, including CGI programs, other RewriteRule directives, or
 CustomLog directives.</p>
 
@@ -636,4 +645,4 @@ The <code>L</code> flag can be useful in
 </div><div id="footer">
 <p class="apache">Copyright 2010 The Apache Software Foundation.<br />Licensed
under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version
2.0</a>.</p>
 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a>
| <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a>
| <a href="../sitemap.html">Sitemap</a></p></div>
-</body></html>
+</body></html>
\ No newline at end of file

Modified: httpd/httpd/trunk/docs/manual/rewrite/flags.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/flags.xml?rev=960233&r1=960232&r2=960233&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/flags.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/flags.xml Sat Jul  3 16:21:58 2010
@@ -203,7 +203,7 @@ is run, thus unsetting what you have set
 Environment Variables document</a> for more details on how Environment
 variables work.</p>
 
-<p>The syntax for this flag is:</p>
+<p>The full syntax for this flag is:</p>
 
 <example>
 [E=VAR:VAL]
@@ -212,7 +212,16 @@ variables work.</p>
 <p><code>VAL</code> may contain backreferences (<code>$N</code>
or
 <code>%N</code>) which will be expanded.</p>
 
-<p>These environment variables can then be used in a variety of
+<p>Using the short form</p>
+
+<example>
+[E=VAR]
+</example>
+
+<p>you can set the environment variable named <code>VAR</code> to an
+empty value.</p>
+
+<p>Environment variables can then be used in a variety of
 contexts, including CGI programs, other RewriteRule directives, or
 CustomLog directives.</p>
 

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=960233&r1=960232&r2=960233&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Sat Jul  3 16:21:58 2010
@@ -2389,12 +2389,14 @@ static void do_expand_env(data_item *env
         name = do_expand(env->data, ctx, NULL);
         if ((val = ap_strchr(name, ':')) != NULL) {
             *val++ = '\0';
-
-            apr_table_set(ctx->r->subprocess_env, name, val);
-            rewritelog((ctx->r, 5, NULL, "setting env variable '%s' to '%s'",
-                        name, val));
+        } else {
+            val = "";
         }
 
+        apr_table_set(ctx->r->subprocess_env, name, val);
+        rewritelog((ctx->r, 5, NULL, "setting env variable '%s' to '%s'",
+                    name, val));
+
         env = env->next;
     }
 



Mime
View raw message