@@ -1752,7 +1752,6 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
1752
1752
#else
1753
1753
char * old_cwd ;
1754
1754
#endif
1755
- char * old_primary_file_path = NULL ;
1756
1755
int retval = 0 ;
1757
1756
1758
1757
EG (exit_status ) = 0 ;
@@ -1789,16 +1788,14 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
1789
1788
/* Only lookup the real file path and add it to the included_files list if already opened
1790
1789
* otherwise it will get opened and added to the included_files list in zend_execute_scripts
1791
1790
*/
1792
- if (primary_file -> filename && primary_file -> type != ZEND_HANDLE_FILENAME ) {
1791
+ if (primary_file -> filename &&
1792
+ primary_file -> opened_path == NULL &&
1793
+ primary_file -> type != ZEND_HANDLE_FILENAME ) {
1793
1794
int realfile_len ;
1794
1795
int dummy = 1 ;
1795
1796
if (VCWD_REALPATH (primary_file -> filename , realfile )) {
1796
1797
realfile_len = strlen (realfile );
1797
1798
zend_hash_add (& EG (included_files ), realfile , realfile_len + 1 , (void * )& dummy , sizeof (int ), NULL );
1798
- if (strncmp (realfile , primary_file -> filename , realfile_len )) {
1799
- old_primary_file_path = primary_file -> filename ;
1800
- primary_file -> filename = realfile ;
1801
- }
1802
1799
}
1803
1800
}
1804
1801
@@ -1827,10 +1824,6 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
1827
1824
zend_set_timeout (INI_INT ("max_execution_time" ));
1828
1825
retval = (zend_execute_scripts (ZEND_REQUIRE TSRMLS_CC , NULL , 3 , prepend_file_p , primary_file , append_file_p ) == SUCCESS );
1829
1826
1830
- if (old_primary_file_path ) {
1831
- primary_file -> filename = old_primary_file_path ;
1832
- }
1833
-
1834
1827
} zend_end_try ();
1835
1828
1836
1829
#if HAVE_BROKEN_GETCWD
0 commit comments