From: William A. Rowe Jr Date: Mon, 22 Apr 2002 17:06:35 +0000 (+0000) Subject: Backport of httpd-2.0/modules/mappers/mod_rewrite.c 1.84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68e7c61aab9b5beeb876cdc8ff57c41f24fd4cc4;p=thirdparty%2Fapache%2Fhttpd.git Backport of httpd-2.0/modules/mappers/mod_rewrite.c 1.84 PR: 7492 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94756 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/modules/standard/mod_rewrite.c b/src/modules/standard/mod_rewrite.c index 91665abafc8..729b2fa39a5 100644 --- a/src/modules/standard/mod_rewrite.c +++ b/src/modules/standard/mod_rewrite.c @@ -1220,7 +1220,7 @@ static int hook_uri2file(request_rec *r) rewritelog(r, 2, "local path result: %s", r->filename); /* the filename has to start with a slash! */ - if (r->filename[0] != '/') { + if (ap_os_is_path_absolute(r->filename)) { return BAD_REQUEST; } @@ -1505,7 +1505,7 @@ static int hook_fixup(request_rec *r) } /* the filename has to start with a slash! */ - if (r->filename[0] != '/') { + if (ap_os_is_path_absolute(r->filename)) { return BAD_REQUEST; } @@ -1983,7 +1983,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, * location, i.e. if it's not starting with either a slash * or a fully qualified URL scheme. */ - if (prefixstrip && r->filename[0] != '/' + if (prefixstrip && !ap_os_is_path_absolute(r->filename) && !is_absolute_uri(r->filename)) { rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s", perdir, r->filename, perdir, r->filename); @@ -2070,7 +2070,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, * not start with a slash. Here we add again the initially * stripped per-directory prefix. */ - if (prefixstrip && r->filename[0] != '/') { + if (prefixstrip && !ap_os_is_path_absolute(r->filename)) { rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s", perdir, r->filename, perdir, r->filename); r->filename = ap_pstrcat(r->pool, perdir, r->filename, NULL);