mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
- Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
This commit is contained in:
parent
a311dc2443
commit
32b5f8a1a3
@ -406,6 +406,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
case 's':
|
||||
{
|
||||
char **p = va_arg(*va, char **);
|
||||
@ -432,17 +433,23 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, const cha
|
||||
}
|
||||
*p = Z_STRVAL_PP(arg);
|
||||
*pl = Z_STRLEN_PP(arg);
|
||||
if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
|
||||
return "valid path";
|
||||
}
|
||||
break;
|
||||
|
||||
case IS_OBJECT:
|
||||
if (parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) {
|
||||
if (c == 'p' && CHECK_ZVAL_NULL_PATH(*arg)) {
|
||||
return "valid path";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IS_ARRAY:
|
||||
case IS_RESOURCE:
|
||||
default:
|
||||
return "string";
|
||||
return c == 's' ? "string" : "valid path";
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -708,7 +715,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
|
||||
case 'z': case 'Z':
|
||||
case 'C': case 'h':
|
||||
case 'f': case 'A':
|
||||
case 'H':
|
||||
case 'H': case 'p':
|
||||
max_num_args++;
|
||||
break;
|
||||
|
||||
|
@ -526,6 +526,9 @@ END_EXTERN_C()
|
||||
#define CHECK_ZVAL_STRING_REL(z)
|
||||
#endif
|
||||
|
||||
#define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p)))
|
||||
#define CHECK_NULL_PATH(p, l) (strlen(p) != l)
|
||||
|
||||
#define ZVAL_RESOURCE(z, l) do { \
|
||||
zval *__z = (z); \
|
||||
Z_LVAL_P(__z) = l; \
|
||||
|
@ -3637,58 +3637,66 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
|
||||
inc_filename = &tmp_inc_filename;
|
||||
}
|
||||
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
|
@ -2285,58 +2285,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
inc_filename = &tmp_inc_filename;
|
||||
}
|
||||
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
@ -6538,58 +6546,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
|
||||
inc_filename = &tmp_inc_filename;
|
||||
}
|
||||
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
@ -10817,58 +10833,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
inc_filename = &tmp_inc_filename;
|
||||
}
|
||||
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
@ -26478,58 +26502,66 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
inc_filename = &tmp_inc_filename;
|
||||
}
|
||||
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
zend_file_handle file_handle;
|
||||
char *resolved_path;
|
||||
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
|
||||
if (resolved_path) {
|
||||
failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
resolved_path = Z_STRVAL_P(inc_filename);
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
if (failure_retval) {
|
||||
/* do nothing, file already included */
|
||||
} else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
|
||||
|
||||
if (!file_handle.opened_path) {
|
||||
file_handle.opened_path = estrdup(resolved_path);
|
||||
}
|
||||
|
||||
if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
|
||||
zend_destroy_file_handle(&file_handle TSRMLS_CC);
|
||||
} else {
|
||||
zend_file_handle_dtor(&file_handle TSRMLS_CC);
|
||||
failure_retval=1;
|
||||
}
|
||||
} else {
|
||||
if (opline->extended_value == ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
if (resolved_path != Z_STRVAL_P(inc_filename)) {
|
||||
efree(resolved_path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->extended_value, inc_filename TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
|
||||
|
||||
new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
|
@ -385,12 +385,14 @@ static PHP_FUNCTION(bzopen)
|
||||
|
||||
/* If it's not a resource its a string containing the filename to open */
|
||||
if (Z_TYPE_PP(file) == IS_STRING) {
|
||||
convert_to_string_ex(file);
|
||||
|
||||
if (Z_STRLEN_PP(file) == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (CHECK_ZVAL_NULL_PATH(*file)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
stream = php_stream_bz2open(NULL,
|
||||
Z_STRVAL_PP(file),
|
||||
|
@ -379,7 +379,7 @@ CPH_METHOD(SaveToFile)
|
||||
|
||||
res = get_persist_file(helper);
|
||||
if (helper->ipf) {
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b",
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b",
|
||||
&filename, &filename_len, &remember)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
@ -443,7 +443,7 @@ CPH_METHOD(LoadFromFile)
|
||||
res = get_persist_file(helper);
|
||||
if (helper->ipf) {
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
|
||||
&filename, &filename_len, &flags)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
|
@ -1979,7 +1979,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
int is_valid;
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2068,7 +2068,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
|
||||
int is_valid;
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,7 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
|
||||
int pwllen;
|
||||
int pos;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &pwl, &pwllen) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &broker, &pwl, &pwllen) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -3938,7 +3938,7 @@ PHP_FUNCTION(exif_read_data)
|
||||
image_info_type ImageInfo;
|
||||
char tmp[64], *sections_str, *s;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4119,7 +4119,7 @@ PHP_FUNCTION(exif_thumbnail)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (zend_parse_parameters(arg_c TSRMLS_CC, "s|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
|
||||
if (zend_parse_parameters(arg_c TSRMLS_CC, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ PHP_FUNCTION(finfo_open)
|
||||
FILEINFO_DECLARE_INIT_OBJECT(object)
|
||||
char resolved_path[MAXPATHLEN];
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &options, &file, &file_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lp", &options, &file, &file_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -607,7 +607,7 @@ PHP_FUNCTION(ftp_chmod)
|
||||
int filename_len;
|
||||
long mode;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -660,7 +660,7 @@ PHP_FUNCTION(ftp_nlist)
|
||||
char **nlist, **ptr, *dir;
|
||||
int dir_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &dir, &dir_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -857,7 +857,7 @@ PHP_FUNCTION(ftp_get)
|
||||
int local_len, remote_len;
|
||||
long mode, resumepos=0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1124,7 +1124,7 @@ PHP_FUNCTION(ftp_put)
|
||||
long mode, startpos=0;
|
||||
php_stream *instream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1177,7 +1177,7 @@ PHP_FUNCTION(ftp_nb_put)
|
||||
long mode, startpos=0;
|
||||
php_stream *instream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1233,7 +1233,7 @@ PHP_FUNCTION(ftp_size)
|
||||
char *file;
|
||||
int file_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1253,7 +1253,7 @@ PHP_FUNCTION(ftp_mdtm)
|
||||
char *file;
|
||||
int file_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2673,7 +2673,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
/* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */
|
||||
/* The quality parameter for gd2 stands for chunk size */
|
||||
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "r|sll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4592,7 +4592,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
|
||||
long ignore_warning;
|
||||
#endif
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sslll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
* from imagey<type>().
|
||||
*/
|
||||
if (image_type == PHP_GDIMG_TYPE_XBM) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -141,6 +141,9 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (isfilename) {
|
||||
if (CHECK_NULL_PATH(data, data_len)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
|
||||
if (!stream) {
|
||||
/* Stream will report errors opening file */
|
||||
|
@ -144,7 +144,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
|
||||
int n;
|
||||
php_stream *stream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ PHP_FUNCTION(sha1_file)
|
||||
int n;
|
||||
php_stream *stream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1153,7 +1153,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
zval *params = NULL;
|
||||
int argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "sss|lla", &mailbox, &mailbox_len, &user, &user_len,
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "pss|lla", &mailbox, &mailbox_len, &user, &user_len,
|
||||
&passwd, &passwd_len, &flags, &retries, ¶ms) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
@ -233,21 +233,16 @@ PHP_FUNCTION(oci_lob_import)
|
||||
int filename_len;
|
||||
|
||||
if (getThis()) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(filename) != filename_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
|
||||
RETURN_FALSE;
|
||||
@ -872,7 +867,7 @@ PHP_FUNCTION(oci_lob_export)
|
||||
ub4 lob_length;
|
||||
|
||||
if (getThis()) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -886,7 +881,7 @@ PHP_FUNCTION(oci_lob_export)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -900,11 +895,6 @@ PHP_FUNCTION(oci_lob_export)
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(filename) != filename_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
|
||||
RETURN_FALSE;
|
||||
|
@ -1317,6 +1317,10 @@ PHP_FUNCTION(odbc_execute)
|
||||
if (Z_STRLEN_PP(tmp) > 2 &&
|
||||
Z_STRVAL_PP(tmp)[0] == '\'' &&
|
||||
Z_STRVAL_PP(tmp)[Z_STRLEN_PP(tmp) - 1] == '\'') {
|
||||
|
||||
if (CHECK_ZVAL_NULL_PATH(*tmp)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
filename = estrndup(&Z_STRVAL_PP(tmp)[1], Z_STRLEN_PP(tmp) - 2);
|
||||
filename[strlen(filename)] = '\0';
|
||||
|
||||
|
@ -1259,7 +1259,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
|
||||
char * filename;
|
||||
int filename_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|b", &zcert, &filename, &filename_len, ¬ext) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zp|b", &zcert, &filename, &filename_len, ¬ext) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
RETVAL_FALSE;
|
||||
@ -1808,7 +1808,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
|
||||
zval ** item;
|
||||
STACK_OF(X509) *ca = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zszs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zpzs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
|
||||
return;
|
||||
|
||||
RETVAL_FALSE;
|
||||
@ -2255,7 +2255,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
|
||||
BIO * bio_out;
|
||||
long csr_resource;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &zcsr, &filename, &filename_len, ¬ext) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp|b", &zcsr, &filename, &filename_len, ¬ext) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
RETVAL_FALSE;
|
||||
@ -3039,7 +3039,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
|
||||
BIO * bio_out = NULL;
|
||||
const EVP_CIPHER * cipher;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zṕ|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
RETVAL_FALSE;
|
||||
@ -3327,7 +3327,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
|
||||
|
||||
RETVAL_LONG(-1);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|sass", &filename, &filename_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|papp", &filename, &filename_len,
|
||||
&flags, &signersfilename, &signersfilename_len, &cainfo,
|
||||
&extracerts, &extracerts_len, &datafilename, &datafilename_len) == FAILURE) {
|
||||
return;
|
||||
@ -3440,7 +3440,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
|
||||
|
||||
RETVAL_FALSE;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZa!|ll", &infilename, &infilename_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZa!|ll", &infilename, &infilename_len,
|
||||
&outfilename, &outfilename_len, &zrecipcerts, &zheaders, &flags, &cipherid) == FAILURE)
|
||||
return;
|
||||
|
||||
@ -3576,7 +3576,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
|
||||
char * outfilename; int outfilename_len;
|
||||
char * extracertsfilename = NULL; int extracertsfilename_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZZa!|ls",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZZa!|lp",
|
||||
&infilename, &infilename_len, &outfilename, &outfilename_len,
|
||||
&zcert, &zprivkey, &zheaders, &flags, &extracertsfilename,
|
||||
&extracertsfilename_len) == FAILURE) {
|
||||
@ -3680,7 +3680,7 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
|
||||
char * infilename; int infilename_len;
|
||||
char * outfilename; int outfilename_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZ|Z", &infilename, &infilename_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZ|Z", &infilename, &infilename_len,
|
||||
&outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile)
|
||||
ExecStatusType status;
|
||||
php_stream *stream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|sss",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
|
||||
&table_name, &table_name_len, &filename, &filename_len,
|
||||
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
|
||||
return;
|
||||
@ -722,7 +722,7 @@ static PHP_METHOD(PDO, pgsqlCopyToFile)
|
||||
|
||||
php_stream *stream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|sss",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
|
||||
&table_name, &table_name_len, &filename, &filename_len,
|
||||
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
|
||||
return;
|
||||
|
@ -3322,17 +3322,17 @@ PHP_FUNCTION(pg_lo_import)
|
||||
Oid returned_oid;
|
||||
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"rs|z", &pgsql_link, &file_in, &name_len, &oid) == SUCCESS) {
|
||||
"rp|z", &pgsql_link, &file_in, &name_len, &oid) == SUCCESS) {
|
||||
;
|
||||
}
|
||||
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"s|z", &file_in, &name_len, &oid) == SUCCESS) {
|
||||
"p|z", &file_in, &name_len, &oid) == SUCCESS) {
|
||||
id = PGG(default_link);
|
||||
CHECK_DEFAULT_LINK(id);
|
||||
}
|
||||
/* old calling convention, deprecated since PHP 4.2 */
|
||||
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"sr", &file_in, &name_len, &pgsql_link ) == SUCCESS) {
|
||||
"pr", &file_in, &name_len, &pgsql_link ) == SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
|
||||
}
|
||||
else {
|
||||
@ -3412,7 +3412,7 @@ PHP_FUNCTION(pg_lo_export)
|
||||
|
||||
/* allow string to handle large OID value correctly */
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"rls", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) {
|
||||
"rlp", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) {
|
||||
if (oid_long <= InvalidOid) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
|
||||
RETURN_FALSE;
|
||||
@ -3429,7 +3429,7 @@ PHP_FUNCTION(pg_lo_export)
|
||||
}
|
||||
}
|
||||
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"ls", &oid_long, &file_out, &name_len) == SUCCESS) {
|
||||
"lp", &oid_long, &file_out, &name_len) == SUCCESS) {
|
||||
if (oid_long <= InvalidOid) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
|
||||
RETURN_FALSE;
|
||||
@ -3439,7 +3439,7 @@ PHP_FUNCTION(pg_lo_export)
|
||||
CHECK_DEFAULT_LINK(id);
|
||||
}
|
||||
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"ss", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
|
||||
"sp", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
|
||||
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
|
||||
if ((oid_string+oid_strlen) != end_ptr) {
|
||||
/* wrong integer format */
|
||||
@ -3450,7 +3450,7 @@ PHP_FUNCTION(pg_lo_export)
|
||||
CHECK_DEFAULT_LINK(id);
|
||||
}
|
||||
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"ssr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) {
|
||||
"spr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) {
|
||||
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
|
||||
if ((oid_string+oid_strlen) != end_ptr) {
|
||||
/* wrong integer format */
|
||||
@ -3459,7 +3459,7 @@ PHP_FUNCTION(pg_lo_export)
|
||||
}
|
||||
}
|
||||
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
|
||||
"lsr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) {
|
||||
"lpr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
|
||||
if (oid_long <= InvalidOid) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
|
||||
|
@ -38,7 +38,7 @@ PHAR_FUNC(phar_opendir) /* {{{ */
|
||||
goto skip_phar;
|
||||
}
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &filename, &filename_len, &zcontext) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|z", &filename, &filename_len, &zcontext) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
|
||||
}
|
||||
|
||||
/* Parse arguments */
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
|
||||
goto skip_phar;
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
|
||||
&& !cached_phars.arBuckets) {
|
||||
goto skip_phar;
|
||||
}
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
|
||||
goto skip_phar;
|
||||
}
|
||||
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
|
||||
@ -340,7 +340,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
|
||||
/* no need to check, include_path not even specified in fopen/ no active phars */
|
||||
goto skip_phar;
|
||||
}
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ss|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
|
||||
goto skip_phar;
|
||||
}
|
||||
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
|
||||
@ -813,7 +813,7 @@ void fname(INTERNAL_FUNCTION_PARAMETERS) { \
|
||||
char *filename; \
|
||||
int filename_len; \
|
||||
\
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { \
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
@ -905,7 +905,7 @@ PHAR_FUNC(phar_is_file) /* {{{ */
|
||||
&& !cached_phars.arBuckets) {
|
||||
goto skip_phar;
|
||||
}
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
goto skip_phar;
|
||||
}
|
||||
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
|
||||
@ -972,7 +972,7 @@ PHAR_FUNC(phar_is_link) /* {{{ */
|
||||
&& !cached_phars.arBuckets) {
|
||||
goto skip_phar;
|
||||
}
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
goto skip_phar;
|
||||
}
|
||||
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
|
||||
|
@ -838,7 +838,7 @@ PHP_FUNCTION(posix_mkfifo)
|
||||
long mode;
|
||||
int result;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &path, &path_len, &mode) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &path, &path_len, &mode) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -871,7 +871,7 @@ PHP_FUNCTION(posix_mknod)
|
||||
|
||||
php_dev = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ll", &path, &path_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|ll", &path, &path_len,
|
||||
&mode, &major, &minor) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@ -951,7 +951,7 @@ PHP_FUNCTION(posix_access)
|
||||
int filename_len, ret;
|
||||
char *filename, *path;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &mode) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,7 @@ static PHP_FUNCTION(pspell_new_personal)
|
||||
PspellManager *manager;
|
||||
PspellConfig *config;
|
||||
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "ss|sssl", &personal, &personal_len, &language, &language_len,
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "ps|sssl", &personal, &personal_len, &language, &language_len,
|
||||
&spelling, &spelling_len, &jargon, &jargon_len, &encoding, &encoding_len, &mode) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@ -825,7 +825,7 @@ static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option)
|
||||
int value_len;
|
||||
PspellConfig *config;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &conf, &value, &value_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &value, &value_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -874,7 +874,7 @@ static PHP_FUNCTION(pspell_config_repl)
|
||||
int repl_len;
|
||||
PspellConfig *config;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &conf, &repl, &repl_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &repl, &repl_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ PHP_FUNCTION(readline_read_history)
|
||||
char *arg = NULL;
|
||||
int arg_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -398,7 +398,7 @@ PHP_FUNCTION(readline_write_history)
|
||||
char *arg = NULL;
|
||||
int arg_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1365,7 +1365,7 @@ SXE_METHOD(asXML)
|
||||
}
|
||||
|
||||
if (ZEND_NUM_ARGS() == 1) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -2148,7 +2148,7 @@ PHP_FUNCTION(simplexml_load_file)
|
||||
zend_class_entry *ce= sxe_class_entry;
|
||||
zend_bool isprefix = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1682,7 +1682,7 @@ PHP_FUNCTION(snmp_read_mib)
|
||||
char *filename;
|
||||
int filename_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2238,7 +2238,7 @@ SPL_METHOD(SplFileObject, __construct)
|
||||
intern->u.file.open_mode = NULL;
|
||||
intern->u.file.open_mode_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sbr",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbr",
|
||||
&intern->file_name, &intern->file_name_len,
|
||||
&intern->u.file.open_mode, &intern->u.file.open_mode_len,
|
||||
&use_include_path, &intern->u.file.zcontext) == FAILURE) {
|
||||
|
@ -103,7 +103,7 @@ PHP_METHOD(sqlite3, open)
|
||||
db_obj = (php_sqlite3_db_object *)zend_object_store_get_object(object TSRMLS_CC);
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
@ -5093,7 +5093,7 @@ PHP_FUNCTION(highlight_file)
|
||||
zend_syntax_highlighter_ini syntax_highlighter_ini;
|
||||
zend_bool i = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &filename_len, &i) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &i) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -5134,7 +5134,7 @@ PHP_FUNCTION(php_strip_whitespace)
|
||||
zend_lex_state original_lex_state;
|
||||
zend_file_handle file_handle = {0};
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -5864,7 +5864,7 @@ PHP_FUNCTION(parse_ini_file)
|
||||
zend_file_handle fh;
|
||||
zend_ini_parser_cb_t ini_parser_cb;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ PHP_FUNCTION(chdir)
|
||||
char *str;
|
||||
int ret, str_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ PHP_FUNCTION(glob)
|
||||
int ret;
|
||||
zend_bool basedir_limit = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &pattern, &pattern_len, &flags) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -554,7 +554,7 @@ PHP_FUNCTION(scandir)
|
||||
zval *zcontext = NULL;
|
||||
php_stream_context *context = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -831,7 +831,7 @@ PHP_FUNCTION(tempnam)
|
||||
char *p;
|
||||
int fd;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -885,7 +885,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
|
||||
php_stream *stream;
|
||||
php_stream_context *context = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -939,7 +939,7 @@ PHP_FUNCTION(popen)
|
||||
php_stream *stream;
|
||||
char *posix_mode;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &command, &command_len, &mode, &mode_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &command, &command_len, &mode, &mode_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1636,7 +1636,7 @@ PHP_FUNCTION(copy)
|
||||
zval *zcontext = NULL;
|
||||
php_stream_context *context;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2331,7 +2331,7 @@ PHP_FUNCTION(realpath)
|
||||
int filename_len;
|
||||
char resolved_path_buff[MAXPATHLEN];
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ PHP_FUNCTION(disk_total_space)
|
||||
char *path;
|
||||
int path_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -370,7 +370,7 @@ PHP_FUNCTION(disk_free_space)
|
||||
char *path;
|
||||
int path_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
|
||||
int ret;
|
||||
php_stream_wrapper *wrapper;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/", &filename, &filename_len, &group) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &group) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -556,7 +556,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
|
||||
int ret;
|
||||
php_stream_wrapper *wrapper;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/", &filename, &filename_len, &user) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &user) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -659,7 +659,7 @@ PHP_FUNCTION(chmod)
|
||||
mode_t imode;
|
||||
php_stream_wrapper *wrapper;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &filename, &filename_len, &mode) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &filename, &filename_len, &mode) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -707,7 +707,7 @@ PHP_FUNCTION(touch)
|
||||
struct utimbuf *newtime = &newtimebuf;
|
||||
php_stream_wrapper *wrapper;
|
||||
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "s|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -817,7 +817,7 @@ PHP_FUNCTION(clearstatcache)
|
||||
char *filename = NULL;
|
||||
int filename_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bs", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1068,7 +1068,7 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
|
||||
char *filename; \
|
||||
int filename_len; \
|
||||
\
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { \
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
|
@ -35,7 +35,7 @@ PHP_FUNCTION(ftok)
|
||||
int pathname_len, proj_len;
|
||||
key_t k;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ PHP_FUNCTION(iptcembed)
|
||||
struct stat sb;
|
||||
zend_bool written = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ PHP_FUNCTION(linkinfo)
|
||||
struct stat sb;
|
||||
int ret;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ PHP_FUNCTION(symlink)
|
||||
char dirname[MAXPATHLEN];
|
||||
size_t len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ PHP_FUNCTION(link)
|
||||
char source_p[MAXPATHLEN];
|
||||
char dest_p[MAXPATHLEN];
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ PHP_FUNCTION(readlink)
|
||||
int link_len;
|
||||
char target[MAXPATHLEN];
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ PHP_FUNCTION(linkinfo)
|
||||
struct stat sb;
|
||||
int ret;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ PHP_FUNCTION(symlink)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
|
||||
int n;
|
||||
php_stream *stream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ PHP_FUNCTION(sha1_file)
|
||||
int n;
|
||||
php_stream *stream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
|
||||
TidyBuffer *errbuf;
|
||||
zval **config = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -1272,7 +1272,7 @@ static PHP_FUNCTION(tidy_parse_file)
|
||||
|
||||
PHPTidyObj *obj;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &inputfile, &input_len,
|
||||
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@ -1586,7 +1586,7 @@ static TIDY_DOC_METHOD(__construct)
|
||||
PHPTidyObj *obj;
|
||||
TIDY_SET_CONTEXT;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sZsb", &inputfile, &input_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|pZsb", &inputfile, &input_len,
|
||||
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@ -1620,7 +1620,7 @@ static TIDY_DOC_METHOD(parseFile)
|
||||
|
||||
obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &inputfile, &input_len,
|
||||
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
|
||||
xmlRelaxNGPtr schema = NULL;
|
||||
char *source;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -872,7 +872,7 @@ PHP_METHOD(xmlreader, open)
|
||||
char resolved_path[MAXPATHLEN + 1];
|
||||
xmlTextReaderPtr reader = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -958,7 +958,7 @@ PHP_METHOD(xmlreader, setSchema)
|
||||
xmlreader_object *intern;
|
||||
char *source;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!", &source, &source_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -634,7 +634,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
|
||||
intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
sheetp = (xsltStylesheetPtr) intern->ptr;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "os", &docp, &uri, &uri_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "op", &docp, &uri, &uri_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -840,7 +840,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
|
||||
int filename_len;
|
||||
DOM_GET_THIS(id);
|
||||
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s!", &filename, &filename_len) == SUCCESS) {
|
||||
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p!", &filename, &filename_len) == SUCCESS) {
|
||||
intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
if (intern->profiling) {
|
||||
efree(intern->profiling);
|
||||
|
@ -1211,7 +1211,7 @@ static PHP_NAMED_FUNCTION(zif_zip_open)
|
||||
zip_rsrc *rsrc_int;
|
||||
int err = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1495,7 +1495,7 @@ static ZIPARCHIVE_METHOD(open)
|
||||
zval *this = getThis();
|
||||
ze_zip_object *ze_obj = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1664,12 +1664,12 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
|
||||
ZIP_FROM_OBJECT(intern, this);
|
||||
/* 1 == glob, 2==pcre */
|
||||
if (type == 1) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|la",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|la",
|
||||
&pattern, &pattern_len, &flags, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sa",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sa",
|
||||
&pattern, &pattern_len, &path, &path_len, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@ -1783,7 +1783,7 @@ static ZIPARCHIVE_METHOD(addFile)
|
||||
|
||||
ZIP_FROM_OBJECT(intern, this);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sll",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sll",
|
||||
&filename, &filename_len, &entry_name, &entry_name_len, &offset_start, &offset_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@ -1882,7 +1882,7 @@ static ZIPARCHIVE_METHOD(statName)
|
||||
|
||||
ZIP_FROM_OBJECT(intern, this);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
|
||||
&name, &name_len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@ -1938,7 +1938,7 @@ static ZIPARCHIVE_METHOD(locateName)
|
||||
|
||||
ZIP_FROM_OBJECT(intern, this);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
|
||||
&name, &name_len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
@ -2518,7 +2518,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
|
||||
ZIP_FROM_OBJECT(intern, this);
|
||||
|
||||
if (type == 1) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &len, &flags) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ll", &filename, &filename_len, &len, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
PHP_ZIP_STAT_PATH(intern, filename, filename_len, flags, sb);
|
||||
@ -2594,7 +2594,7 @@ static ZIPARCHIVE_METHOD(getStream)
|
||||
|
||||
ZIP_FROM_OBJECT(intern, this);
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -431,7 +431,7 @@ static PHP_FUNCTION(gzfile)
|
||||
long use_include_path = 0;
|
||||
php_stream *stream;
|
||||
|
||||
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &use_include_path)) {
|
||||
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &use_include_path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -477,7 +477,7 @@ PHPAPI char *php_resolve_path(const char *filename, int filename_length, const c
|
||||
char *actual_path;
|
||||
php_stream_wrapper *wrapper;
|
||||
|
||||
if (!filename) {
|
||||
if (!filename || CHECK_NULL_PATH(filename, filename_length)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ PHP_FUNCTION(virtual)
|
||||
int filename_len;
|
||||
request_rec *rr = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ PHP_FUNCTION(virtual)
|
||||
int filename_len;
|
||||
request_rec *rr;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ PHP_FUNCTION(apache_lookup_uri)
|
||||
char *filename;
|
||||
int filename_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ PHP_FUNCTION(virtual)
|
||||
int filename_len;
|
||||
request_rec *rr;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ PHP_FUNCTION(apache_lookup_uri)
|
||||
char *filename;
|
||||
int filename_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user