From: Ilia Alshanetsky Date: Mon, 25 Sep 2006 14:48:33 +0000 (+0000) Subject: Fixed bug #38904 (apache2filter changes cwd to /). X-Git-Tag: php-5.2.0RC5~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ccc25cc3eb46c87d8f83f73c66a503e9f29fad07;p=php Fixed bug #38904 (apache2filter changes cwd to /). --- diff --git a/NEWS b/NEWS index 651ba32540..a3c80dbc17 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ PHP NEWS (Dmitry) - Fixed bug #38941 (imap extension does not compile against new version of the imap library). (Ilia) +- Fixed bug #38904 (apache2filter changes cwd to /). (Ilia, bjori) - Fixed bug #38844 (curl_easy_strerror() is defined only since cURL 7.12.0). (Tony) - Fixed bug #38623 (leaks in a tricky code with switch() and exceptions). diff --git a/main/main.c b/main/main.c index b9249ba4f0..37a13b3cc1 100644 --- a/main/main.c +++ b/main/main.c @@ -1704,8 +1704,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) PG(during_request_startup) = 0; - if (primary_file->type == ZEND_HANDLE_FILENAME - && primary_file->filename) { + if ((primary_file->type == ZEND_HANDLE_FILENAME || primary_file->type == ZEND_HANDLE_STREAM) && primary_file->filename) { #if HAVE_BROKEN_GETCWD /* this looks nasty to me */ old_cwd_fd = open(".", 0);