diff options
author | Sander Roobol <sander@php.net> | 2002-06-30 13:38:16 +0000 |
---|---|---|
committer | Sander Roobol <sander@php.net> | 2002-06-30 13:38:16 +0000 |
commit | d325d07b1a8e867f88a2080fbcd48df5cbba3f81 (patch) | |
tree | 106d3a6ef6d29a3ff0a23990def9de78b0349b10 | |
parent | bf4e59449bbbcb8b682b0ede7cce90458e0814f5 (diff) | |
download | php-git-d325d07b1a8e867f88a2080fbcd48df5cbba3f81.tar.gz |
Main script should not be parsed when (include|require)_once()'ed, #17720
# Derick, MFH?
-rw-r--r-- | main/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c index 28a7a73ca7..cae8a504d6 100644 --- a/main/main.c +++ b/main/main.c @@ -1356,6 +1356,16 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) VCWD_CHDIR_FILE(primary_file->filename); } + if(primary_file->filename) { + char *realfile; + int dummy = 1; + realfile = emalloc(PATH_MAX); + if(realpath(primary_file->filename, realfile)) { + zend_hash_add(&EG(included_files), realfile, strlen(realfile)+1, (void *)&dummy, sizeof(int), NULL); + } + efree(realfile); + } + if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) { prepend_file.filename = PG(auto_prepend_file); prepend_file.opened_path = NULL; |