summaryrefslogtreecommitdiff
path: root/main/fopen_wrappers.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/fopen_wrappers.c')
-rw-r--r--main/fopen_wrappers.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 0815f68810..4ea926d920 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -228,7 +228,7 @@ PHPAPI FILE *php3_fopen_for_parser(void)
PLS_FETCH();
SLS_FETCH();
- fn = request_info.filename;
+ fn = SG(request_info).path_translated;
path_info = SG(request_info).request_uri;
#if HAVE_PWD_H
if (PG(user_dir) && *PG(user_dir)
@@ -256,8 +256,8 @@ PHPAPI FILE *php3_fopen_for_parser(void)
strcat(fn, PG(user_dir)); /* safe */
strcat(fn, "/"); /* safe */
strcat(fn, s + 1); /* safe (shorter than path_info) */
- STR_FREE(request_info.filename);
- request_info.filename = fn;
+ STR_FREE(SG(request_info).path_translated);
+ SG(request_info).path_translated = fn;
}
}
}
@@ -279,17 +279,17 @@ PHPAPI FILE *php3_fopen_for_parser(void)
if ('/' == path_info[0])
l--;
strcpy(fn + l, path_info);
- STR_FREE(request_info.filename);
- request_info.filename = fn;
+ STR_FREE(SG(request_info).path_translated);
+ SG(request_info).path_translated = fn;
}
} /* if doc_root && path_info */
if (!fn) {
- /* we have to free request_info.filename here because
+ /* we have to free SG(request_info).path_translated here because
php3_destroy_request_info assumes that it will get
freed when the include_names hash is emptied, but
we're not adding it in this case */
- STR_FREE(request_info.filename);
- request_info.filename = NULL;
+ STR_FREE(SG(request_info).path_translated);
+ SG(request_info).path_translated = NULL;
return NULL;
}
fp = fopen(fn, "r");
@@ -301,7 +301,7 @@ PHPAPI FILE *php3_fopen_for_parser(void)
}
if (!fp) {
php3_error(E_CORE_ERROR, "Unable to open %s", fn);
- STR_FREE(request_info.filename); /* for same reason as above */
+ STR_FREE(SG(request_info).path_translated); /* for same reason as above */
return NULL;
}
@@ -311,6 +311,7 @@ PHPAPI FILE *php3_fopen_for_parser(void)
chdir(temp);
}
efree(temp);
+ SG(request_info).path_translated = fn;
return fp;
}