From: Antony Dovgal Date: Thu, 31 Aug 2006 15:17:08 +0000 (+0000) Subject: ext/filter z/Z fixes X-Git-Tag: RELEASE_1_0_0RC1~1807 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bee846b80e4f4b9672bb0c6972b71cfd3e1d4557;p=php ext/filter z/Z fixes --- diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 8efd4af601..5d791b3f4c 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -511,7 +511,7 @@ PHP_FUNCTION(input_get) long arg, filter = FILTER_DEFAULT; char *var, *charset = NULL; int var_len, charset_len; - zval *flags = NULL; + zval **flags = NULL; zval **tmp; zval *array_ptr = NULL, *array_ptr2 = NULL, *array_ptr3 = NULL; HashTable *hash_ptr; @@ -519,21 +519,21 @@ PHP_FUNCTION(input_get) long filter_flags = 0; zval *options = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|lzs", &arg, &var, &var_len, &filter, &flags, &charset, &charset_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|lZs", &arg, &var, &var_len, &filter, &flags, &charset, &charset_len) == FAILURE) { return; } if (flags) { - switch (Z_TYPE_P(flags)) { + switch (Z_TYPE_PP(flags)) { case IS_ARRAY: - options = flags; + options = *flags; break; case IS_STRING: case IS_BOOL: case IS_LONG: - convert_to_long(flags); - filter_flags = Z_LVAL_P(flags); + convert_to_long_ex(flags); + filter_flags = Z_LVAL_PP(flags); options = NULL; break; } @@ -844,41 +844,41 @@ PHP_FUNCTION(filter_data) long filter = FILTER_DEFAULT; char *charset = NULL; int charset_len; - zval *var, *flags = NULL; + zval *var, **flags = NULL; int filter_flags = 0; zval *options = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/l|zs", &var, &filter, &flags, &charset, &charset_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/l|Zs", &var, &filter, &flags, &charset, &charset_len) == FAILURE) { return; } if (filter != FILTER_CALLBACK) { if (flags) { - switch (Z_TYPE_P(flags)) { + switch (Z_TYPE_PP(flags)) { case IS_ARRAY: - options = flags; + options = *flags; break; case IS_STRING: case IS_BOOL: case IS_LONG: - convert_to_long(flags); - filter_flags = Z_LVAL_P(flags); + convert_to_long_ex(flags); + filter_flags = Z_LVAL_PP(flags); options = NULL; break; } } } else { if (flags) { - switch (Z_TYPE_P(flags)) { + switch (Z_TYPE_PP(flags)) { case IS_ARRAY: case IS_STRING: - options = flags; + options = *flags; break; default: - convert_to_string(flags); - options = flags; + convert_to_string_ex(flags); + options = *flags; break; } }