You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2007/11/10 23:15:35 UTC

svn commit: r593816 - in /httpd/httpd/trunk: CHANGES modules/generators/mod_autoindex.c

Author: rpluem
Date: Sat Nov 10 14:15:34 2007
New Revision: 593816

URL: http://svn.apache.org/viewvc?rev=593816&view=rev
Log:
* Generate valid XHTML output by adding the xhtml namespace.

PR: 43649
Submitted by: Jose Kahan <jose w3.org>
Reviewed by: rpluem

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/generators/mod_autoindex.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=593816&r1=593815&r2=593816&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Nov 10 14:15:34 2007
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_autoindex: Generate valid XHTML output by adding the xhtml
+     namespace. PR 43649 [Jose Kahan <jose w3.org>]
+
   *) core: Add the option to keep aside a request body up to a certain
      size that would otherwise be discarded, to be consumed by filters
      such as mod_include. When enabled for a directory, POST requests

Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=593816&r1=593815&r2=593816&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Sat Nov 10 14:15:34 2007
@@ -160,9 +160,18 @@
     d = (autoindex_config_rec *) ap_get_module_config(r->per_dir_config,
                                                       &autoindex_module);
 
-    ap_rvputs(r, xhtml ? DOCTYPE_XHTML_1_0T : DOCTYPE_HTML_3_2,
-              "<html>\n <head>\n  <title>Index of ", title,
-              "</title>\n", NULL);
+    if (xhtml) {
+        ap_rvputs(r, DOCTYPE_XHTML_1_0T,
+		  "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
+		  "<head>\n  <title>Index of ", title,
+		  "</title>\n", NULL);
+    } else {
+        ap_rvputs(r, DOCTYPE_HTML_3_2,
+		  "<html>\n <head>\n"
+		  "<title>Index of ", title,
+		  "</title>\n", NULL);
+    }
+
     if (d->style_sheet != NULL) {
         ap_rvputs(r, "  <link rel=\"stylesheet\" href=\"", d->style_sheet,
                 "\" type=\"text/css\"", xhtml ? " />\n" : ">\n", NULL);