summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_vm_def.h9
-rw-r--r--Zend/zend_vm_execute.h36
2 files changed, 15 insertions, 30 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index d79ac34695..d015ed2919 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2833,23 +2833,20 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
zend_file_handle file_handle;
char cwd[MAXPATHLEN];
cwd_state state;
-#ifndef PHP_WIN32
+
if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
cwd[0] = '\0';
} else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
cwd[0] = '\0';
}
-#endif
+
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);
-#ifndef PHP_WIN32
if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
failure_retval=1;
- } else
-#endif
- if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 15f1b9dd0c..5723a45f3e 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1914,23 +1914,20 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_file_handle file_handle;
char cwd[MAXPATHLEN];
cwd_state state;
-#ifndef PHP_WIN32
+
if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
cwd[0] = '\0';
} else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
cwd[0] = '\0';
}
-#endif
+
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);
-#ifndef PHP_WIN32
if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
failure_retval=1;
- } else
-#endif
- if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
@@ -4503,23 +4500,20 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_file_handle file_handle;
char cwd[MAXPATHLEN];
cwd_state state;
-#ifndef PHP_WIN32
+
if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
cwd[0] = '\0';
} else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
cwd[0] = '\0';
}
-#endif
+
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);
-#ifndef PHP_WIN32
if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
failure_retval=1;
- } else
-#endif
- if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
@@ -7689,23 +7683,20 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_file_handle file_handle;
char cwd[MAXPATHLEN];
cwd_state state;
-#ifndef PHP_WIN32
+
if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
cwd[0] = '\0';
} else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
cwd[0] = '\0';
}
-#endif
+
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);
-#ifndef PHP_WIN32
if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
failure_retval=1;
- } else
-#endif
- if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
@@ -20595,23 +20586,20 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_file_handle file_handle;
char cwd[MAXPATHLEN];
cwd_state state;
-#ifndef PHP_WIN32
+
if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
cwd[0] = '\0';
} else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
cwd[0] = '\0';
}
-#endif
+
state.cwd_length = strlen(cwd);
state.cwd = zend_strndup(cwd, state.cwd_length);
-#ifndef PHP_WIN32
if (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)) {
failure_retval=1;
- } else
-#endif
- if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}