]> granicus.if.org Git - php/commitdiff
Main script should not be parsed when (include|require)_once()'ed, #17720
authorSander Roobol <sander@php.net>
Sun, 30 Jun 2002 13:38:16 +0000 (13:38 +0000)
committerSander Roobol <sander@php.net>
Sun, 30 Jun 2002 13:38:16 +0000 (13:38 +0000)
# Derick, MFH?

main/main.c

index 28a7a73ca7adf3d10c863a85e5090c3eca431b2b..cae8a504d60bcae8c3b554b29789a2327660eea6 100644 (file)
@@ -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;