This patch is against Apache 1.3.11. It may be updated as the situation warrants. Last updated: Wed Feb 2 01:09:23 MST 2000 Index: htdocs/manual/mod/core.html =================================================================== RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/core.html,v retrieving revision 1.162 diff -u -r1.162 core.html --- core.html 2000/01/18 19:32:49 1.162 +++ core.html 2000/02/02 07:59:17 @@ -23,6 +23,8 @@
AddDefaultCharset off
+If enabled, any response that does not have any parameter on the content
+type in the HTTP headers will have a charset parameter added specifying
+the character set the client should use for the document. This will
+override any character set specified in the body of the document via a
+META
tag. The character set added is specified by the
+AddDefaultCharsetName
directive.
+
AddDefaultCharsetName iso-8859-1
+This directive specifies the name of the character set that will be added +if the AddDefaultCharset directive is +enabled. +
(none)
.
Any dates printed are subject to the currently configured timefmt
.
+
Attributes:
echo
element,
+the default is set to "entity", resulting in entity encoding (which
+is appropriate in the context of a block-level HTML element, eg.
+a paragraph of text). This can be changed by adding an
+encoding
attribute, which will remain in effect until
+the next encoding
attribute is encountered or the
+element ends, whichever comes first. Note that only special
+characters as defined in the ISO-8859-1 character encoding will be
+encoded. This encoding process may not have the desired result if
+a different character encoding is in use. Apache 1.3.12 and above; previous
+versions do no encoding.
+
echo
element for details) before being
+ output. No attributes.
<!--#printenv -->
\n" - "Reason: ", message, "", NULL)); + "pool, r->uri), + "\">", r->method, " ", + ap_escape_html(r->pool, r->uri), ".
\n"
+ "Reason: ",
+ ap_escape_html(r->pool, message),
+ "", NULL));
/* Allow the "error-notes" string to be printed by ap_send_error_response() */
ap_table_setn(r->notes, "verbose-error-to", ap_pstrdup(r->pool, "*"));
Index: src/modules/standard/mod_actions.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_actions.c,v
retrieving revision 1.33
diff -u -r1.33 mod_actions.c
--- mod_actions.c 2000/01/11 14:23:03 1.33
+++ mod_actions.c 2000/02/02 07:59:30
@@ -195,7 +195,8 @@
{
action_dir_config *conf = (action_dir_config *)
ap_get_module_config(r->per_dir_config, &action_module);
- const char *t, *action = r->handler ? r->handler : r->content_type;
+ const char *t, *action = r->handler ? r->handler :
+ ap_field_noparam(r->pool, r->content_type);
const char *script;
int i;
Index: src/modules/standard/mod_autoindex.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v
retrieving revision 1.113
diff -u -r1.113 mod_autoindex.c
--- mod_autoindex.c 1999/12/31 05:35:52 1.113
+++ mod_autoindex.c 2000/02/02 07:59:30
@@ -732,7 +732,7 @@
static char *find_item(request_rec *r, array_header *list, int path_only)
{
- const char *content_type = r->content_type;
+ const char *content_type = ap_field_noparam(r->pool, r->content_type);
const char *content_encoding = r->content_encoding;
char *path = r->filename;
Index: src/modules/standard/mod_expires.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_expires.c,v
retrieving revision 1.33
diff -u -r1.33 mod_expires.c
--- mod_expires.c 1999/10/21 20:45:26 1.33
+++ mod_expires.c 2000/02/02 07:59:30
@@ -437,7 +437,8 @@
if (r->content_type == NULL)
code = NULL;
else
- code = (char *) ap_table_get(conf->expiresbytype, r->content_type);
+ code = (char *) ap_table_get(conf->expiresbytype,
+ ap_field_noparam(r->pool, r->content_type));
if (code == NULL) {
/* no expires defined for that type, is there a default? */
Index: src/modules/standard/mod_include.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v
retrieving revision 1.121
diff -u -r1.121 mod_include.c
--- mod_include.c 1999/12/31 05:35:52 1.121
+++ mod_include.c 2000/02/02 07:59:30
@@ -922,7 +922,10 @@
{
char tag[MAX_STRING_LEN];
char *tag_val;
+ enum {E_NONE, E_URL, E_ENTITY} encode;
+ encode = E_ENTITY;
+
while (1) {
if (!(tag_val = get_tag(r->pool, in, tag, sizeof(tag), 1))) {
return 1;
@@ -931,7 +934,15 @@
const char *val = ap_table_get(r->subprocess_env, tag_val);
if (val) {
- ap_rputs(val, r);
+ if (encode == E_NONE) {
+ ap_rputs(val, r);
+ }
+ else if (encode == E_URL) {
+ ap_rputs(ap_escape_uri(r->pool, val), r);
+ }
+ else if (encode == E_ENTITY) {
+ ap_rputs(ap_escape_html(r->pool, val), r);
+ }
}
else {
ap_rputs("(none)", r);
@@ -940,6 +951,19 @@
else if (!strcmp(tag, "done")) {
return 0;
}
+ else if (!strcmp(tag, "encoding")) {
+ if (!strcasecmp(tag_val, "none")) encode = E_NONE;
+ else if (!strcasecmp(tag_val, "url")) encode = E_URL;
+ else if (!strcasecmp(tag_val, "entity")) encode = E_ENTITY;
+ else {
+ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
+ "unknown value \"%s\" to parameter \"encoding\" of "
+ "tag echo in %s",
+ tag_val, r->filename);
+ ap_rputs(error, r);
+ }
+ }
+
else {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
"unknown parameter \"%s\" to tag echo in %s",
@@ -2116,7 +2140,8 @@
}
else if (!strcmp(tag, "done")) {
for (i = 0; i < arr->nelts; ++i) {
- ap_rvputs(r, elts[i].key, "=", elts[i].val, "\n", NULL);
+ ap_rvputs(r, ap_escape_html(r->pool, elts[i].key), "=",
+ ap_escape_html(r->pool, elts[i].val), "\n", NULL);
}
return 0;
}
Index: src/modules/standard/mod_log_config.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_config.c,v
retrieving revision 1.80
diff -u -r1.80 mod_log_config.c
--- mod_log_config.c 1999/12/15 23:04:22 1.80
+++ mod_log_config.c 2000/02/02 07:59:30
@@ -391,7 +391,7 @@
{
const char *cp = ap_table_get(r->headers_out, a);
if (!strcasecmp(a, "Content-type") && r->content_type) {
- cp = r->content_type;
+ cp = ap_field_noparam(r->pool, r->content_type);
}
if (cp) {
return cp;
Index: src/modules/standard/mod_status.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v
retrieving revision 1.110
diff -u -r1.110 mod_status.c
--- mod_status.c 2000/01/12 15:55:02 1.110
+++ mod_status.c 2000/02/02 07:59:31
@@ -597,9 +597,10 @@
format_byte_out(r, bytes);
ap_rputs(")\n", r);
ap_rprintf(r, " %s {%s} [%s]
\n\n",
- score_record.client,
+ ap_escape_html(r->pool, score_record.client),
ap_escape_html(r->pool, score_record.request),
- vhost ? vhost->server_hostname : "(unavailable)");
+ vhost ? ap_escape_html(r->pool,
+ vhost->server_hostname) : "(unavailable)");
}
else { /* !no_table_report */
if (score_record.status == SERVER_DEAD)
@@ -671,8 +672,9 @@
else
ap_rprintf(r,
"