summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2016-03-13 15:29:38 +0000
committerJeff Trawick <trawick@apache.org>2016-03-13 15:29:38 +0000
commit33931c9953a38b9189536209985bb104072f1327 (patch)
treeda011ebb08c7177c8bd4d9c308b576198686b12c
parentc703004b3c0ef28d3239820f2dceea05b469f7b0 (diff)
downloadhttpd-33931c9953a38b9189536209985bb104072f1327.tar.gz
mod_include now sets DOCUMENT_ARGS.
* Like DOCUMENT_URI, this is for the SSI document, not for any subrequest called for the include directive. * Like QUERY_STRING, this is just r->args (or empty string if there are none), unlike QUERY_STRING_UNESCAPED. The name of the variable is taken from the Zeus SSI implementation. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734817 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES3
-rw-r--r--docs/manual/mod/mod_include.xml20
-rw-r--r--modules/filters/mod_include.c1
3 files changed, 20 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 1a5cb305cf..b3e2f2b403 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_include: Add variable DOCUMENT_ARGS, with the arguments to the
+ request for the SSI document. [Jeff Trawick]
+
*) core: Extend support for setting aside data from the network input filter
to any connection or request input filter. [Graham Leggett]
diff --git a/docs/manual/mod/mod_include.xml b/docs/manual/mod/mod_include.xml
index 1b8599629d..e2eb1d93a0 100644
--- a/docs/manual/mod/mod_include.xml
+++ b/docs/manual/mod/mod_include.xml
@@ -543,10 +543,22 @@ AddOutputFilter INCLUDES .shtml
the user.</dd>
<dt><code>QUERY_STRING_UNESCAPED</code></dt>
- <dd>If a query string is present, this variable contains the
- (%-decoded) query string, which is <em>escaped</em> for shell
- usage (special characters like <code>&amp;</code> etc. are
- preceded by backslashes).</dd>
+ <dd>If a query string is present in the request for the active
+ SSI document, this variable contains the (%-decoded) query
+ string, which is <em>escaped</em> for shell usage (special
+ characters like <code>&amp;</code> etc. are preceded by
+ backslashes). It is not set if a query string is not
+ present. Use <code>DOCUMENT_ARGS</code> if shell escaping
+ is not desired.</dd>
+
+ <dt><code>DOCUMENT_ARGS</code></dt>
+ <dd>This variable contains the query string of the active SSI
+ document, or the empty string if a query string is not
+ included. For subrequests invoked through the
+ <code>include</code> SSI directive, <code>QUERY_STRING</code>
+ will represent the query string of the subrequest and
+ <code>DOCUMENT_ARGS</code> will represent the query string of
+ the SSI document.</dd>
</dl>
</section>
diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c
index 2e24b0de6c..e73b762f94 100644
--- a/modules/filters/mod_include.c
+++ b/modules/filters/mod_include.c
@@ -598,6 +598,7 @@ static void add_include_vars(request_rec *r)
apr_table_setn(e, "DATE_GMT", LAZY_VALUE);
apr_table_setn(e, "LAST_MODIFIED", LAZY_VALUE);
apr_table_setn(e, "DOCUMENT_URI", r->uri);
+ apr_table_setn(e, "DOCUMENT_ARGS", r->args ? r->args : "");
if (r->path_info && *r->path_info) {
apr_table_setn(e, "DOCUMENT_PATH_INFO", r->path_info);
}