You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/09/25 07:32:25 UTC

[PATCH] PR#1155: RedirectMatch does not deal with urls that need to be escaped

RedirectMatch /foo(.*) http://yaddayadda/bar$1

doesn't handle requests for things like /foo/do%20wah%20ditty properly. 
This patch fixes that.

Dean

Index: mod_alias.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v
retrieving revision 1.24
diff -u -r1.24 mod_alias.c
--- mod_alias.c	1997/09/16 05:31:56	1.24
+++ mod_alias.c	1997/09/25 05:20:48
@@ -295,9 +295,13 @@
 	int l;
 
 	if (p->regexp) {
-	    if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0))
+	    if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0)) {
 		found = pregsub(r->pool, p->real, r->uri,
 				p->regexp->re_nsub + 1, regm);
+		if (found && doesc) {
+		    found = escape_uri(r->pool, found);
+		}
+	    }
 	}
 	else {
 	    l = alias_matches(r->uri, p->fake);