]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport of httpd-2.0/modules/mappers/mod_rewrite.c 1.84
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 22 Apr 2002 17:06:35 +0000 (17:06 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 22 Apr 2002 17:06:35 +0000 (17:06 +0000)
PR: 7492

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@94756 13f79535-47bb-0310-9956-ffa450edef68

src/modules/standard/mod_rewrite.c

index 91665abafc8195108b531a30d76265f069bec9f3..729b2fa39a5f68fcbd8ab63e2cc53cf9a6aa00ee 100644 (file)
@@ -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);