]> granicus.if.org Git - apache/commitdiff
Merge r1737476 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 6 Jun 2016 19:10:42 +0000 (19:10 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 6 Jun 2016 19:10:42 +0000 (19:10 +0000)
Add the <!--#comment ... --> syntax.
Idea from Rob.
Submitted by: jailletc36
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1747054 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
docs/manual/mod/mod_include.xml
modules/filters/mod_include.c

diff --git a/CHANGES b/CHANGES
index 6bcbaf13dd579877c12a469e00505fc4013305c2..2f1663b8597ed521a9bba9899c46f0ae9408fe42 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.21
 
+  *) mod_include: add the <!--#comment ...> syntax in order to include comments
+     in a SSI file. [Christophe Jaillet based on a suggestion from Rob]
+
   *) mod_http2: improved event handling for suspended streams, responses
      and window updates. [Stefan Eissing] 
      
diff --git a/STATUS b/STATUS
index 763df57686641833ae33879a552c2d84a09277e9..8ac0a2d580d89f4b4208b0dbde311fca5b2a006c 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -114,11 +114,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- *) mod_include: add the <!--#comment ...> syntax in order to include comments
-     in a SSI file.
-     Trunk patch: http://svn.apache.org/r1737476
-     2.4.x patch: trunk patch works (compatibility note to be adjusted)
-     +1: jailletc36, gsmith, covener
 
  *) core: save a few bytes in conf pool.
      trunk patch: http://svn.apache.org/r1744980
index 40cf8f671e68c6e5e5a6a6a96045129ba0ed7b2c..d143b0830461c2175572b5b05dad3a43a485516a 100644 (file)
@@ -110,6 +110,8 @@ Options +Includes
 
     <table border="1">
     <tr><th>Element</th><th>Description</th></tr>
+    <tr><td><code><a href="#element.comment">comment</a></code></td>
+        <td>SSI comment</td></tr>
     <tr><td><code><a href="#element.config">config</a></code></td>
         <td>configure output formats</td></tr>
     <tr><td><code><a href="#element.echo">echo</a></code></td>
@@ -134,6 +136,17 @@ Options +Includes
     <module>mod_cgi</module>, and will only be available if this
     module is loaded.</p>
 
+    <section id="element.comment"><title>The comment Element</title>
+      <p>This command doesn't output anything. Its only use is to
+      add comments within a file. These comments are not printed.</p>
+
+      <p>This syntax is available in version 2.5 and later.</p>
+
+      <example>
+      &lt;!--#comment Blah Blah Blah --&gt;
+      </example>
+    </section> <!-- /comment -->
+
     <section id="element.config"><title>The config Element</title>
       <p>This command controls various aspects of the parsing. The
       valid attributes are:</p>
index 0f3527c0fedb8aa7564dc37997bd15a302104ee0..5a6271c5f7bf34b11b63f00c93f2ca39c34c48d6 100644 (file)
@@ -1762,6 +1762,15 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
     }
 }
 
+/*
+ * <!--#comment blah blah blah ... -->
+ */
+static apr_status_t handle_comment(include_ctx_t *ctx, ap_filter_t *f,
+                                   apr_bucket_brigade *bb)
+{
+    return APR_SUCCESS;
+}
+
 /*
  * <!--#include virtual|file="..." [onerror|virtual|file="..."] ... -->
  *
@@ -4160,6 +4169,7 @@ static int include_post_config(apr_pool_t *p, apr_pool_t *plog,
         ssi_pfn_register("endif", handle_endif);
         ssi_pfn_register("fsize", handle_fsize);
         ssi_pfn_register("config", handle_config);
+        ssi_pfn_register("comment", handle_comment);
         ssi_pfn_register("include", handle_include);
         ssi_pfn_register("flastmod", handle_flastmod);
         ssi_pfn_register("printenv", handle_printenv);