httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] PR#1155: RedirectMatch does not deal with urls that need to be escaped
Date Thu, 25 Sep 1997 05:32:25 GMT
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);



Mime
View raw message