Skip to content

Commit 5cbfb69

Browse files
committed
ext/filter: Remove unused parameters
1 parent 38ecfc5 commit 5cbfb69

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

ext/filter/filter.c

+13-13
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static unsigned int php_sapi_filter_init(void)
231231
return SUCCESS;
232232
}
233233

234-
static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, bool copy) /* {{{ */
234+
static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset) /* {{{ */
235235
{
236236
filter_list_entry filter_func;
237237

@@ -327,7 +327,7 @@ static unsigned int php_sapi_filter(int arg, const char *var, char **val, size_t
327327
/* Register mangled variable */
328328
if (IF_G(default_filter) != FILTER_UNSAFE_RAW) {
329329
ZVAL_STRINGL(&new_var, *val, val_len);
330-
php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL, 0);
330+
php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL);
331331
} else {
332332
ZVAL_STRINGL(&new_var, *val, val_len);
333333
}
@@ -356,7 +356,7 @@ static unsigned int php_sapi_filter(int arg, const char *var, char **val, size_t
356356
}
357357
/* }}} */
358358

359-
static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, bool copy) /* {{{ */
359+
static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset) /* {{{ */
360360
{
361361
if (Z_TYPE_P(value) == IS_ARRAY) {
362362
zval *element;
@@ -370,14 +370,14 @@ static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long f
370370
ZVAL_DEREF(element);
371371
if (Z_TYPE_P(element) == IS_ARRAY) {
372372
SEPARATE_ARRAY(element);
373-
php_zval_filter_recursive(element, filter, flags, options, charset, copy);
373+
php_zval_filter_recursive(element, filter, flags, options, charset);
374374
} else {
375-
php_zval_filter(element, filter, flags, options, charset, copy);
375+
php_zval_filter(element, filter, flags, options, charset);
376376
}
377377
} ZEND_HASH_FOREACH_END();
378378
Z_UNPROTECT_RECURSION_P(value);
379379
} else {
380-
php_zval_filter(value, filter, flags, options, charset, copy);
380+
php_zval_filter(value, filter, flags, options, charset);
381381
}
382382
}
383383
/* }}} */
@@ -449,7 +449,7 @@ PHP_FUNCTION(filter_has_var)
449449

450450
static void php_filter_call(
451451
zval *filtered, zend_long filter, HashTable *filter_args_ht, zend_long filter_args_long,
452-
const int copy, zend_long filter_flags
452+
zend_long filter_flags
453453
) /* {{{ */ {
454454
zval *options = NULL;
455455
zval *option;
@@ -501,7 +501,7 @@ static void php_filter_call(
501501
}
502502
return;
503503
}
504-
php_zval_filter_recursive(filtered, filter, filter_flags, options, charset, copy);
504+
php_zval_filter_recursive(filtered, filter, filter_flags, options, charset);
505505
return;
506506
}
507507
if (filter_flags & FILTER_REQUIRE_ARRAY) {
@@ -514,7 +514,7 @@ static void php_filter_call(
514514
return;
515515
}
516516

517-
php_zval_filter(filtered, filter, filter_flags, options, charset, copy);
517+
php_zval_filter(filtered, filter, filter_flags, options, charset);
518518
if (filter_flags & FILTER_FORCE_ARRAY) {
519519
zval tmp;
520520
ZVAL_COPY_VALUE(&tmp, filtered);
@@ -532,7 +532,7 @@ static void php_filter_array_handler(zval *input, HashTable *op_ht, zend_long op
532532

533533
if (!op_ht) {
534534
ZVAL_DUP(return_value, input);
535-
php_filter_call(return_value, -1, NULL, op_long, 0, FILTER_REQUIRE_ARRAY);
535+
php_filter_call(return_value, -1, NULL, op_long, FILTER_REQUIRE_ARRAY);
536536
} else {
537537
array_init(return_value);
538538

@@ -556,7 +556,7 @@ static void php_filter_array_handler(zval *input, HashTable *op_ht, zend_long op
556556
php_filter_call(&nval, -1,
557557
Z_TYPE_P(arg_elm) == IS_ARRAY ? Z_ARRVAL_P(arg_elm) : NULL,
558558
Z_TYPE_P(arg_elm) == IS_ARRAY ? 0 : zval_get_long(arg_elm),
559-
0, FILTER_REQUIRE_SCALAR
559+
FILTER_REQUIRE_SCALAR
560560
);
561561
zend_hash_update(Z_ARRVAL_P(return_value), arg_key, &nval);
562562
}
@@ -625,7 +625,7 @@ PHP_FUNCTION(filter_input)
625625

626626
ZVAL_DUP(return_value, tmp);
627627

628-
php_filter_call(return_value, filter, filter_args_ht, filter_args_long, 1, FILTER_REQUIRE_SCALAR);
628+
php_filter_call(return_value, filter, filter_args_ht, filter_args_long, FILTER_REQUIRE_SCALAR);
629629
}
630630
/* }}} */
631631

@@ -651,7 +651,7 @@ PHP_FUNCTION(filter_var)
651651

652652
ZVAL_DUP(return_value, data);
653653

654-
php_filter_call(return_value, filter, filter_args_ht, filter_args_long, 1, FILTER_REQUIRE_SCALAR);
654+
php_filter_call(return_value, filter, filter_args_ht, filter_args_long, FILTER_REQUIRE_SCALAR);
655655
}
656656
/* }}} */
657657

ext/filter/sanitizing_filters.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static const unsigned char hexchars[] = "0123456789ABCDEF";
6060

6161
#define DEFAULT_URL_ENCODE LOWALPHA HIALPHA DIGIT "-._"
6262

63-
static void php_filter_encode_url(zval *value, const unsigned char* chars, const int char_len, int high, int low, int encode_nul)
63+
static void php_filter_encode_url(zval *value, const unsigned char* chars, const int char_len)
6464
{
6565
unsigned char *p;
6666
unsigned char tmp[256];
@@ -216,7 +216,7 @@ void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL)
216216
/* apply strip_high and strip_low filters */
217217
php_filter_strip(value, flags);
218218
/* urlencode */
219-
php_filter_encode_url(value, (unsigned char *)DEFAULT_URL_ENCODE, sizeof(DEFAULT_URL_ENCODE)-1, flags & FILTER_FLAG_ENCODE_HIGH, flags & FILTER_FLAG_ENCODE_LOW, 1);
219+
php_filter_encode_url(value, (unsigned char *)DEFAULT_URL_ENCODE, sizeof(DEFAULT_URL_ENCODE)-1);
220220
}
221221
/* }}} */
222222

0 commit comments

Comments
 (0)