diff options
author | Felipe Pena <felipe@php.net> | 2011-06-06 21:28:16 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2011-06-06 21:28:16 +0000 |
commit | 4737910b69eba83b5ba6dd2d43f88a7bd3461ccf (patch) | |
tree | dc6ecafe9a79a17cbb6d4a96b83a1bcbda30e5a8 /ext/oci8/oci8_interface.c | |
parent | 6b85eb58b27a60cfc4d78ad0a85afeda373132c5 (diff) | |
download | php-git-4737910b69eba83b5ba6dd2d43f88a7bd3461ccf.tar.gz |
- Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
Diffstat (limited to 'ext/oci8/oci8_interface.c')
-rw-r--r-- | ext/oci8/oci8_interface.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index 699eccb4a2..b1d454e612 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -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; |