]> granicus.if.org Git - php/commitdiff
- Added new parameter parsing option (p - for valid path (string without null byte...
authorFelipe Pena <felipe@php.net>
Mon, 6 Jun 2011 21:28:16 +0000 (21:28 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 6 Jun 2011 21:28:16 +0000 (21:28 +0000)
# The tests will be fixed in the next commits

49 files changed:
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/bz2/bz2.c
ext/com_dotnet/com_persist.c
ext/dom/document.c
ext/enchant/enchant.c
ext/exif/exif.c
ext/fileinfo/fileinfo.c
ext/ftp/php_ftp.c
ext/gd/gd.c
ext/gd/gd_ctx.c
ext/hash/hash.c
ext/hash/hash_md.c
ext/hash/hash_sha.c
ext/imap/php_imap.c
ext/oci8/oci8_interface.c
ext/odbc/php_odbc.c
ext/openssl/openssl.c
ext/pdo_pgsql/pgsql_driver.c
ext/pgsql/pgsql.c
ext/phar/func_interceptors.c
ext/posix/posix.c
ext/pspell/pspell.c
ext/readline/readline.c
ext/simplexml/simplexml.c
ext/snmp/snmp.c
ext/spl/spl_directory.c
ext/sqlite3/sqlite3.c
ext/standard/basic_functions.c
ext/standard/dir.c
ext/standard/file.c
ext/standard/filestat.c
ext/standard/ftok.c
ext/standard/iptc.c
ext/standard/link.c
ext/standard/link_win32.c
ext/standard/md5.c
ext/standard/sha1.c
ext/tidy/tidy.c
ext/xmlreader/php_xmlreader.c
ext/xsl/xsltprocessor.c
ext/zip/php_zip.c
ext/zlib/zlib.c
main/fopen_wrappers.c
sapi/apache/php_apache.c
sapi/apache2filter/php_functions.c
sapi/apache2handler/php_functions.c

index ff7d8dfd66e537c173663394113266d2d1dcf72f..cd5e52f20d5a1158cff4e45e954d61994eafcf0c 100644 (file)
@@ -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;
 
index f75ce5038b379d498291e7fc6485eb77ec3e5294..db040f6be46fd34fc73393148fde3610dccdc803 100644 (file)
@@ -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;                      \
index a76352799a06f6886183aba8c55479fefb88f13d..c25b7a7a7471eabb583f5ce3de9b6e7ae4b06529 100644 (file)
@@ -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;
-
-                               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 (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 (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 (!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);
+                                               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 {
-                                               zend_file_handle_dtor(&file_handle TSRMLS_CC);
-                                               failure_retval=1;
+                                               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);
+                                               }
                                        }
-                               } 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);
                                        }
                                }
-                               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);
+                               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()
+                                       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);
index 899aa572bd7241768874b61ef6233cbaf0ac7433..63db4987d679fb335a2f556f6ff06fa34486da37 100644 (file)
@@ -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;
-
-                               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 (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;
 
-                                       if (!file_handle.opened_path) {
-                                               file_handle.opened_path = estrdup(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 (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);
+                                       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 {
-                                               zend_file_handle_dtor(&file_handle TSRMLS_CC);
-                                               failure_retval=1;
+                                               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);
+                                               }
                                        }
-                               } 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);
                                        }
                                }
-                               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);
+                               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()
+                                       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;
-
-                               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 (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;
 
-                                       if (!file_handle.opened_path) {
-                                               file_handle.opened_path = estrdup(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 (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);
+                                       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 {
-                                               zend_file_handle_dtor(&file_handle TSRMLS_CC);
-                                               failure_retval=1;
+                                               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);
+                                               }
                                        }
-                               } 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);
                                        }
                                }
-                               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);
+                               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()
+                                       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;
-
-                               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 (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;
 
-                                       if (!file_handle.opened_path) {
-                                               file_handle.opened_path = estrdup(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 (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);
+                                       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 {
-                                               zend_file_handle_dtor(&file_handle TSRMLS_CC);
-                                               failure_retval=1;
+                                               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);
+                                               }
                                        }
-                               } 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);
                                        }
                                }
-                               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);
+                               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()
+                                       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;
-
-                               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 (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;
 
-                                       if (!file_handle.opened_path) {
-                                               file_handle.opened_path = estrdup(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 (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);
+                                       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 {
-                                               zend_file_handle_dtor(&file_handle TSRMLS_CC);
-                                               failure_retval=1;
+                                               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);
+                                               }
                                        }
-                               } 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);
                                        }
                                }
-                               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);
+                               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()
+                                       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);
index dafe4b25abaf9950b4d246272bb1155c87db7d8f..1e3c7b7617e3b51053a2bf1daeafa74fd0e9c8b1 100644 (file)
@@ -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), 
index 56611987b296ac9b6cf8e906a850f8c0e3c33649..c72bf622a417f42e20b154e5aa5a90b3e6ea3f75 100755 (executable)
@@ -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;
index 6499b55f64d901bb6c9271fe7834391efdaf405a..e01e2c34d66876ae7e86fb92945f6cd744f304f4 100644 (file)
@@ -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;
        }
 
index bfac6f57c5f0450095ccd4db02e2fdec289b419c..81404db53aab176acf08d6726d6f95552b9bbd6a 100755 (executable)
@@ -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;
        }
 
index 04abb953b1fb1144d482f3bb4a78e82241f73b51..f5e837484581ab6430b70850d0d78e75fed65c96 100644 (file)
@@ -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;
        }
 
index e5d28e88cec7dd7daec5df867ca676e385d4a77c..613c043771ef7f701805ed4f4a44e57341de7857 100644 (file)
@@ -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;
        }
 
index e62243e949c40af9c471dc87d59e787d2092204b..6c44733fedfc7e695be259b8e699c37f8aebe606 100644 (file)
@@ -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;
        }
 
index 38abecdd3aafe93501842f48a15ac65da67832b6..1fe321773c5ef9becc9f570e35ea0a8c5c8f4578 100644 (file)
@@ -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;
        }
 
index 15319c1a7823911f1860a017148cdd0208ff63ce..6ee174db7447d97dd5b29b0dca2f43666de7b808 100644 (file)
@@ -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 {
index e994e9e1576666dc2b843294c20cfbbc3ae6eeec..1c2d4241c40d8a64165c463a1d2308c108a63a10 100644 (file)
@@ -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 */
index 6d9f0518b9bdaa6c343e1b8e14938403c8dc85f1..4e7ca282041ba998d11c8153fbe893a67ac68bf2 100644 (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;
        }
        
index 991d7db404ddc75a1a0e6cdd6fd95341039a64fe..6e58c444dcceccf949ffede94f0b67d7d9bd01ef 100644 (file)
@@ -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;
        }
        
index 819ef51b6d32369a4590105b82d5ee5198b78d7e..34fae167633536095ea65d4bc0895eeb088cd477 100644 (file)
@@ -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, &params) == FAILURE) {
                return;
        }
index 699eccb4a2e6328d4c0f343968efd9706fcab6b9..b1d454e61220ac0fbf0dc2c5f98b23de55d1b67f 100644 (file)
@@ -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;
index a036d3b7a725d346421becd21f0fd637e0e46ae2..5275a35b451dbab062abfb6286fabc92b3a82683 100644 (file)
@@ -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';
 
index 4377d2b52e039758517e80c0df3fbcd9e56529c6..0c61b5a254a0a4fb0f940714082b4317d13c244e 100644 (file)
@@ -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, &notext) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zp|b", &zcert, &filename, &filename_len, &notext) == 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, &notext) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp|b", &zcsr, &filename, &filename_len, &notext) == 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;
        }
index 72f811eb3a3e8e164bf2e6118cd0af72165e6dbc..45f05fa2c7656ed352a70449dc1013cec1816540 100644 (file)
@@ -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;
index d321ec4883486e5b6ee99cee58aba3160182ef51..9ab1a071e6ae68fe29d0c771f83095cdf0222dfa 100644 (file)
@@ -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");
index 353bc47072b82dd8d183d392b0aa04f28a226c80..1b3f0f461b809e17828b8f99ff813ec992ccbc90 100644 (file)
@@ -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, "://")) {
index 3ac1dc4dfdcf47cc13226c41fe84855430caabb9..580911afa651e57a540df2be76e2dd41a55bb432 100644 (file)
@@ -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;
        }
 
index fe6c95bb41efd84a23f66a2fb6fec95a863342f5..abdded3fd21f91bca69b7d45b0d9a278520c48e8 100644 (file)
@@ -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;
        }
 
index c47491c199e0c05469e8c7368658dfbe23ee77bd..d199cdf51758e7509f2dc15256eb1f0430759815 100644 (file)
@@ -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;
        }
 
index 98dbc0c13ebcbd73bfe6db0643aeae456bde2143..1d74853cd9c830da923ae3eee78e2e0f72211e44 100644 (file)
@@ -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;
        }
 
index d9a2a032310c3d51d25f37fbcabf17860419e806..e99d5090e5d89e91fcdd1173ee8b6153145f6068 100644 (file)
@@ -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;
        }
 
index 4cb3aece625d8b61fb85bacd843dc4479de6438b..f1eaffe479ef7495cacde3575835ad54f44dc5de 100755 (executable)
@@ -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) {              
index d54eb7c5678119c39d7e6f02462cb9bab2579911..9c922414b877babd9e971dcac78119d82c4738e3 100644 (file)
@@ -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;
        }
index b56f85caee5a2f7f3b2a060995c7a45d9be07df0..698234fe6ecf54ccde4871894dc18c264a321f7f 100644 (file)
@@ -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;
        }
 
index 284553beaf07888cc91b0570115cce9c4d455341..746cd8e238ba090e218e11412e2383a372c0f3bd 100644 (file)
@@ -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;
        }
 
index 868fbab4da535091e5a43b773ab238f82f14d758..c3f167b8079e07e4685b7f79feabc11a68ef5a1c 100644 (file)
@@ -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;
        }
 
index 34b646814638850670db1b53b89c822b5793cd60..5c4c5d465ed8d168f828e0dbc648ea5273aa2edb 100644 (file)
@@ -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; \
        } \
        \
index 809a1e078ac658a4472a7414e6a33f9ebb86fc77..8486eb12c7f81bac275577bb5482b2dca59aeeb8 100644 (file)
@@ -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;
        }
 
index 6da54ccc178972283d1b26a0ca79df37b50503f9..4cac5e092132fa65c029d450e3c4fc68d7234b85 100644 (file)
@@ -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;
        }
 
index 6c0e1cf15d496bf09e2cf7f930cf76bf77fc8a74..f6d474009df4cd64fe4ac15137bc526277111305 100644 (file)
@@ -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;
        }
 
index c5357c7e182534c9117a676eb940f19394835f3a..d7589bbb7b720bf7b9f8b346be7e442f5c5dc3d4 100644 (file)
@@ -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;
        }
        
index 36e49ce44c1a519219e834528f8936373fb72502..0c3557776851954ab9ec14d059774b10df3cc87f 100644 (file)
@@ -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;
        }
        
index 3b552de789265d916f73725f6ad3337a0f0d0a02..2c7cd3e3e04bc7391313b8592dace6069673e464 100644 (file)
@@ -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;
        }
        
index f51f0b45799386ba08bc05b130fb09c9c75ba9c9..cf8e29056919f39e41fd50af34b0d0e0020cc798 100644 (file)
@@ -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;
        }
index b9f6348c04a95e74a4507d7e827a40f2db4e2a68..83d8f5ca8da233d68aee0e6647cf8e9c74e47bb9 100644 (file)
@@ -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;
        }
 
index 2ac2c4bbe15068ea5b99c473bd039e54087f1067..8cb341516700a2768e23071188877f05fcfc85dd 100644 (file)
@@ -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);
index 56abd80beb5a83cd41cd73447d55f5e22fbae3a2..3aa3988e8e1dc424f87a2554e9234547e76840b2 100644 (file)
@@ -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;
        }
 
index 8a14f3b78f0114dbe70ab0d27f67aca997dc01b3..08450a3aa33afc860a992d0faa46cfcaea06d99f 100644 (file)
@@ -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;
        }
 
index 4ec3e5ee7af833a669dd75dcf6dd518a2eec3ac6..812d591767b2127eb786e65f21c838c6aeec201d 100644 (file)
@@ -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;
        }
 
index 58f1c1a5bc5974b2c60cab6ffda9de58733c1113..d2159e9789b8a670b0fa487477aff927bf86de8f 100644 (file)
@@ -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;
        }
        
index 68beefc8f11c446b7bb07d049df74e1f2d400854..0d0a294bed990798c4919de6be9b8a2dec1b7c0e 100644 (file)
@@ -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;
        }
 
index dbad4995d0e042c340b45c8c7ac3df429df38fe8..65f913a217bcb06021c3c12fbad47963150fe8a1 100644 (file)
@@ -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;
        }