You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Dean Gaudet <dg...@hyperreal.org> on 1997/09/26 04:56:44 UTC

cvs commit: apachen/src/modules/standard mod_alias.c

dgaudet     97/09/25 19:56:43

  Modified:    src      CHANGES
               src/modules/standard mod_alias.c
  Log:
  PR#1153: RedirectMatch does not escape its result.
  and unrelated to that PR:  RedirectMatch does not allow constructs
  such as "RedirectMatch /advertiser/(.*) $1".
  
  Reviewed by:	Jim Jagielski, Roy Fielding
  
  Revision  Changes    Path
  1.445     +4 -0      apachen/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/CHANGES,v
  retrieving revision 1.444
  retrieving revision 1.445
  diff -u -r1.444 -r1.445
  --- CHANGES	1997/09/19 17:32:02	1.444
  +++ CHANGES	1997/09/26 02:56:39	1.445
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3b1
   
  +  *) RedirectMatch was not properly escaping the result (PR#1155).  Also
  +     "RedirectMatch /advertiser/(.*) $1" is now permitted.
  +     [Dean Gaudet]
  +
     *) mod_include now uses symbolic names to check for request success
        and return HTTP errors, and correctly handles all types of
        redirections (previously it only did temporary redirect correctly).
  
  
  
  1.25      +6 -2      apachen/src/modules/standard/mod_alias.c
  
  Index: mod_alias.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- mod_alias.c	1997/09/16 05:31:56	1.24
  +++ mod_alias.c	1997/09/26 02:56:42	1.25
  @@ -188,7 +188,7 @@
       if (is_HTTP_REDIRECT(status)) {
   	if (!url)
   	    return "URL to redirect to is missing";
  -	if (!is_url(url))
  +	if (!use_regex && !is_url(url))
   	    return "Redirect to non-URL";
       }
       else {
  @@ -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);