1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00

ext/filter z/Z fixes

This commit is contained in:
Antony Dovgal
2006-08-31 15:17:08 +00:00
parent d08f2e8897
commit bee846b80e
+16 -16
View File
@@ -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;
}
}