You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by rb...@covalent.net on 2001/05/09 18:08:37 UTC

Bad commit message on mod_alias.c

I accidentally committed too much when I backed out the ap_get_brigade()
commit this weekend.

I added a patch to mod_alias.c that solved a problem where we were
escaping too much when using RedirectMatch.  Basically, we were escaping
the entire URL, when in reality we wanted to stop escaping the string as
soon as we found either a ? or a #.

This is the patch that was committed.

Index: modules/mappers/mod_alias.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_alias.c,v
retrieving revision 1.27
diff -u -d -b -w -u -r1.27 mod_alias.c
--- modules/mappers/mod_alias.c	2001/02/18 02:58:52	1.27
+++ modules/mappers/mod_alias.c	2001/05/06 20:08:00
@@ -335,7 +335,16 @@
 		    found = ap_pregsub(r->pool, p->real, r->uri,
 				    p->regexp->re_nsub + 1, regm);
 		    if (found && doesc) {
-			found = ap_escape_uri(r->pool, found);
+                        uri_components uri;
+                        ap_parse_uri_components(r->pool, found, &uri);
+			found = ap_escape_uri(r->pool, uri.path);
+                        if (uri.query) {
+                            found = apr_pstrcat(r->pool, found, "?", uri.query, NULL);
+                        }
+                        else if (uri.fragment) {
+                            found = apr_pstrcat(r->pool, found, "#", uri.fragment, NULL);
+
+                        }
 		    }
 		}
 		else {


Sorry.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------