diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 3cf8b77c890..750bf3dba85 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -518,9 +518,13 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC) char cwd[MAXPATHLEN]; char *result; - result = VCWD_GETCWD(cwd, MAXPATHLEN); - if (!result) { + if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { cwd[0] = '\0'; + } else{ + result = VCWD_GETCWD(cwd, MAXPATHLEN); + if (!result) { + cwd[0] = '\0'; + } } new_state.cwd = strdup(cwd);