Skip to content

Commit eee0bda

Browse files
author
Sam Ruby
committed
Hmmm...must have misplaced the getcwd/chdir logic...
1 parent 94bf353 commit eee0bda

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sapi/servlet/servlet.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
300300
{
301301

302302
zend_file_handle file_handle;
303+
char cwd[MAXPATHLEN+1];
303304
jlong addr = 0;
304305
SLS_FETCH();
305306
PLS_FETCH();
@@ -339,7 +340,9 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
339340
* Parse the file
340341
*/
341342
SETSTRING( SG(request_info).path_translated, pathTranslated );
343+
getcwd(cwd,MAXPATHLEN);
342344
file_handle.handle.fp = php3_fopen_for_parser();
345+
chdir(cwd);
343346
file_handle.filename = SG(request_info).path_translated;
344347
file_handle.free_filename = 0;
345348
file_handle.type = ZEND_HANDLE_FP;

0 commit comments

Comments
 (0)