martin 99/09/23 12:03:08
Modified: src/modules/standard mod_speling.c
Log:
Fix for previous mod_speling redirection fix:
when sending the escaped redirection, mod_speling must preserve
the query suffix (especially, the '?') unescaped.
Revision Changes Path
1.33 +6 -6 apache-1.3/src/modules/standard/mod_speling.c
Index: mod_speling.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_speling.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- mod_speling.c 1999/09/23 18:51:54 1.32
+++ mod_speling.c 1999/09/23 19:03:06 1.33
@@ -408,14 +408,14 @@
&& (candidates->nelts == 1
|| variant[0].quality != variant[1].quality)) {
- nuri = ap_pstrcat(r->pool, url, variant[0].name, r->path_info,
- r->parsed_uri.query ? "?" : "",
- r->parsed_uri.query ? r->parsed_uri.query : "",
- NULL);
+ nuri = ap_escape_uri(r->pool, ap_pstrcat(r->pool, url,
+ variant[0].name,
+ r->path_info, NULL));
+ if (r->parsed_uri.query)
+ nuri = ap_pstrcat(r->pool, nuri, "?", r->parsed_uri.query,
NULL);
ap_table_setn(r->headers_out, "Location",
- ap_escape_uri(r->pool,
- ap_construct_url(r->pool, nuri, r)));
+ ap_construct_url(r->pool, nuri, r));
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, r,
ref ? "Fixed spelling: %s to %s from %s"