summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-03-13 09:35:45 +0000
committerDmitry Stogov <dmitry@php.net>2006-03-13 09:35:45 +0000
commitd21669fc807a85aba09e4ebec0591f38a0d1674b (patch)
tree69b5d2b6f0b83497e86d5ce803c1da3b1035bde2 /main
parent9e90d5b3c06e7c2a900c942f7720f7a6e73267a5 (diff)
downloadphp-git-d21669fc807a85aba09e4ebec0591f38a0d1674b.tar.gz
Fixed realpath() cache for main script with FastCGI SAPI
Diffstat (limited to 'main')
-rw-r--r--main/main.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/main/main.c b/main/main.c
index 4c9c4bc508..0626b5c047 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1647,7 +1647,6 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
#else
char *old_cwd;
#endif
- char *old_primary_file_path = NULL;
int retval = 0;
EG(exit_status) = 0;
@@ -1684,16 +1683,15 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
/* Only lookup the real file path and add it to the included_files list if already opened
* otherwise it will get opened and added to the included_files list in zend_execute_scripts
*/
- if (primary_file->filename && primary_file->type != ZEND_HANDLE_FILENAME) {
+ if (primary_file->filename &&
+ primary_file->opened_path == NULL &&
+ primary_file->type != ZEND_HANDLE_FILENAME) {
int realfile_len;
int dummy = 1;
- if (VCWD_REALPATH(primary_file->filename, realfile)) {
+
+ if (expand_filepath(primary_file->filename, realfile TSRMLS_CC)) {
realfile_len = strlen(realfile);
zend_hash_add(&EG(included_files), realfile, realfile_len+1, (void *)&dummy, sizeof(int), NULL);
- if (strncmp(realfile, primary_file->filename, realfile_len)) {
- old_primary_file_path = primary_file->filename;
- primary_file->filename = realfile;
- }
}
}
@@ -1722,10 +1720,6 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
zend_set_timeout(INI_INT("max_execution_time"));
retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
- if (old_primary_file_path) {
- primary_file->filename = old_primary_file_path;
- }
-
} zend_end_try();
#if HAVE_BROKEN_GETCWD