coar 99/06/05 08:48:14
Modified: src/include httpd.h
src/main http_protocol.c
src/modules/example mod_example.c
src/modules/proxy proxy_ftp.c
src/modules/standard mod_autoindex.c mod_imap.c mod_info.c
mod_status.c
src/modules/test mod_test_util_uri.c
Log:
Normalise the <!DOCTYPE> tags, and make sure we emit the
right one when we're doing 3.2+ things (like <FONT>).
Revision Changes Path
1.281 +17 -0 apache-1.3/src/include/httpd.h
Index: httpd.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v
retrieving revision 1.280
retrieving revision 1.281
diff -u -r1.280 -r1.281
--- httpd.h 1999/06/04 18:30:24 1.280
+++ httpd.h 1999/06/05 15:48:08 1.281
@@ -574,6 +574,23 @@
#define DIR_MAGIC_TYPE "httpd/unix-directory"
#define STATUS_MAGIC_TYPE "application/x-httpd-status"
+/*
+ * Define the HTML doctype strings centrally.
+ */
+#define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
+ "DTD HTML 2.0//EN\">\n"
+#define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
+ "DTD HTML 3.2 Final//EN\">\n"
+#define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
+ "DTD HTML 4.0//EN\"\n" \
+ "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
+#define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
+ "DTD HTML 4.0 Transitional//EN\"\n" \
+ "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
+#define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
+ "DTD HTML 4.0 Frameset//EN\"\n" \
+
"\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
+
/* Just in case your linefeed isn't the one the other end is expecting. */
#ifndef CHARSET_EBCDIC
#define LF 10
1.270 +1 -1 apache-1.3/src/main/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
retrieving revision 1.269
retrieving revision 1.270
diff -u -r1.269 -r1.270
--- http_protocol.c 1999/06/02 20:11:19 1.269
+++ http_protocol.c 1999/06/05 15:48:09 1.270
@@ -2453,7 +2453,7 @@
h1 = &title[4];
ap_rvputs(r,
- "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
+ DOCTYPE_HTML_2_0
"<HTML><HEAD>\n<TITLE>", title,
"</TITLE>\n</HEAD><BODY>\n<H1>", h1, "</H1>\n",
NULL);
1.34 +1 -1 apache-1.3/src/modules/example/mod_example.c
Index: mod_example.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/example/mod_example.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- mod_example.c 1999/01/01 19:05:00 1.33
+++ mod_example.c 1999/06/05 15:48:10 1.34
@@ -525,7 +525,7 @@
* Now send our actual output. Since we tagged this as being
* "text/html", we need to embed any HTML.
*/
- ap_rputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n", r);
+ ap_rputs(DOCTYPE_HTML_3_2, r);
ap_rputs("<HTML>\n", r);
ap_rputs(" <HEAD>\n", r);
ap_rputs(" <TITLE>mod_example Module Content-Handler Output\n", r);
1.76 +1 -1 apache-1.3/src/modules/proxy/proxy_ftp.c
Index: proxy_ftp.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_ftp.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- proxy_ftp.c 1999/05/01 17:02:28 1.75
+++ proxy_ftp.c 1999/06/05 15:48:11 1.76
@@ -291,7 +291,7 @@
path[n-1] = '\0';
/* print "ftp://host/" */
- n = ap_snprintf(buf, sizeof(buf), "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
HTML 3.2 Final//EN\">\n"
+ n = ap_snprintf(buf, sizeof(buf), DOCTYPE_HTML_3_2
"<HTML><HEAD><TITLE>%s%s</TITLE>\n"
"<BASE HREF=\"%s%s\"></HEAD>\n"
"<BODY><H2>Directory of "
1.110 +1 -1 apache-1.3/src/modules/standard/mod_autoindex.c
Index: mod_autoindex.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- mod_autoindex.c 1999/06/04 18:30:35 1.109
+++ mod_autoindex.c 1999/06/05 15:48:12 1.110
@@ -192,7 +192,7 @@
*/
static void emit_preamble(request_rec *r, char *title)
{
- ap_rvputs(r, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2
Final//EN\">\n",
+ ap_rvputs(r, DOCTYPE_HTML_3_2,
"<HTML>\n <HEAD>\n <TITLE>Index of ", title,
"</TITLE>\n </HEAD>\n <BODY>\n", NULL);
}
1.51 +1 -1 apache-1.3/src/modules/standard/mod_imap.c
Index: mod_imap.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_imap.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- mod_imap.c 1999/01/01 19:05:09 1.50
+++ mod_imap.c 1999/06/05 15:48:12 1.51
@@ -508,7 +508,7 @@
ap_send_http_header(r);
ap_hard_timeout("send menu", r); /* killed in menu_footer */
- ap_rvputs(r, "<html><head>\n<title>Menu for ", r->uri,
+ ap_rvputs(r, DOCTYPE_HTML_3_2, "<html><head>\n<title>Menu for ", r->uri,
"</title>\n</head><body>\n", NULL);
if (!strcasecmp(menu, "formatted")) {
1.45 +2 -1 apache-1.3/src/modules/standard/mod_info.c
Index: mod_info.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_info.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- mod_info.c 1999/01/01 19:05:10 1.44
+++ mod_info.c 1999/06/05 15:48:12 1.45
@@ -378,7 +378,8 @@
}
ap_hard_timeout("send server info", r);
- ap_rputs("<html><head><title>Server Information</title></head>\n", r);
+ ap_rputs(DOCTYPE_HTML_3_2
+ "<html><head><title>Server Information</title></head>\n", r);
ap_rputs("<body><h1 align=center>Apache Server Information</h1>\n", r);
if (!r->args || strcasecmp(r->args, "list")) {
cfname = ap_server_root_relative(r->pool, ap_server_confname);
1.107 +3 -1 apache-1.3/src/modules/standard/mod_status.c
Index: mod_status.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_status.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- mod_status.c 1999/02/02 22:09:48 1.106
+++ mod_status.c 1999/06/05 15:48:12 1.107
@@ -341,7 +341,9 @@
ap_hard_timeout("send status info", r);
if (!short_report) {
- ap_rputs("<HTML><HEAD>\n<TITLE>Apache Status</TITLE>\n</HEAD><BODY>\n",
r);
+ ap_rputs(DOCTYPE_HTML_3_2
+ "<HTML><HEAD>\n<TITLE>Apache Status</TITLE>\n</HEAD><BODY>\n",
+ r);
ap_rputs("<H1>Apache Server Status for ", r);
ap_rvputs(r, ap_get_server_name(r), "</H1>\n\n", NULL);
ap_rvputs(r, "Server Version: ",
1.7 +2 -1 apache-1.3/src/modules/test/mod_test_util_uri.c
Index: mod_test_util_uri.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/test/mod_test_util_uri.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mod_test_util_uri.c 1999/01/01 19:05:26 1.6
+++ mod_test_util_uri.c 1999/06/05 15:48:14 1.7
@@ -275,7 +275,8 @@
}
ap_hard_timeout("test_util_uri", r);
- ap_rputs("
+ ap_rputs(
+DOCTYPE_HTML_2_0 "
<html><body>
<p>Key:
<dl>