@@ -195,7 +195,7 @@ static bool php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret
195
195
}
196
196
/* }}} */
197
197
198
- void php_filter_int (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
198
+ zend_result php_filter_int (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
199
199
{
200
200
zval * option_val ;
201
201
zend_long min_range , max_range , option_flags ;
@@ -266,12 +266,12 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
266
266
} else {
267
267
zval_ptr_dtor (value );
268
268
ZVAL_LONG (value , ctx_value );
269
- return ;
270
269
}
270
+ return SUCCESS ;
271
271
}
272
272
/* }}} */
273
273
274
- void php_filter_boolean (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
274
+ zend_result php_filter_boolean (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
275
275
{
276
276
const char * str = Z_STRVAL_P (value );
277
277
size_t len = Z_STRLEN_P (value );
@@ -337,10 +337,11 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
337
337
zval_ptr_dtor (value );
338
338
ZVAL_BOOL (value , ret );
339
339
}
340
+ return SUCCESS ;
340
341
}
341
342
/* }}} */
342
343
343
- void php_filter_float (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
344
+ zend_result php_filter_float (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
344
345
{
345
346
size_t len ;
346
347
const char * str , * end ;
@@ -467,10 +468,11 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
467
468
RETURN_VALIDATION_FAILED
468
469
}
469
470
efree (num );
471
+ return SUCCESS ;
470
472
}
471
473
/* }}} */
472
474
473
- void php_filter_validate_regexp (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
475
+ zend_result php_filter_validate_regexp (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
474
476
{
475
477
zval * option_val ;
476
478
zend_string * regexp ;
@@ -503,6 +505,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
503
505
if (rc < 0 ) {
504
506
RETURN_VALIDATION_FAILED
505
507
}
508
+ return SUCCESS ;
506
509
}
507
510
508
511
static bool php_filter_validate_domain_ex (const zend_string * domain , zend_long flags ) /* {{{ */
@@ -557,11 +560,12 @@ static bool php_filter_validate_domain_ex(const zend_string *domain, zend_long f
557
560
}
558
561
/* }}} */
559
562
560
- void php_filter_validate_domain (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
563
+ zend_result php_filter_validate_domain (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
561
564
{
562
565
if (!php_filter_validate_domain_ex (Z_STR_P (value ), flags )) {
563
566
RETURN_VALIDATION_FAILED
564
567
}
568
+ return SUCCESS ;
565
569
}
566
570
/* }}} */
567
571
@@ -589,7 +593,7 @@ static bool php_filter_is_valid_ipv6_hostname(const zend_string *s)
589
593
return * ZSTR_VAL (s ) == '[' && * t == ']' && _php_filter_validate_ipv6 (ZSTR_VAL (s ) + 1 , ZSTR_LEN (s ) - 2 , NULL );
590
594
}
591
595
592
- void php_filter_validate_url (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
596
+ zend_result php_filter_validate_url (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
593
597
{
594
598
php_url * url ;
595
599
size_t old_len = Z_STRLEN_P (value );
@@ -646,10 +650,11 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
646
650
}
647
651
648
652
php_url_free (url );
653
+ return SUCCESS ;
649
654
}
650
655
/* }}} */
651
656
652
- void php_filter_validate_email (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
657
+ zend_result php_filter_validate_email (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
653
658
{
654
659
/*
655
660
* The regex below is based on a regex by Michael Rushton.
@@ -715,6 +720,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
715
720
if (rc < 0 ) {
716
721
RETURN_VALIDATION_FAILED
717
722
}
723
+ return SUCCESS ;
718
724
719
725
}
720
726
/* }}} */
@@ -975,7 +981,7 @@ static bool ipv6_get_status_flags(const int ip[8], bool *global, bool *reserved,
975
981
* to throw out reserved ranges; multicast ranges... etc. If both allow_ipv4
976
982
* and allow_ipv6 flags flag are used, then the first dot or colon determine
977
983
* the format */
978
- void php_filter_validate_ip (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
984
+ zend_result php_filter_validate_ip (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
979
985
{
980
986
int ip [8 ];
981
987
int mode ;
@@ -1003,7 +1009,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
1003
1009
}
1004
1010
1005
1011
if (!ipv4_get_status_flags (ip , & flag_global , & flag_reserved , & flag_private )) {
1006
- return ; /* no special block */
1012
+ return SUCCESS ; /* no special block */
1007
1013
}
1008
1014
}
1009
1015
else if (mode == FORMAT_IPV6 ) {
@@ -1012,7 +1018,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
1012
1018
}
1013
1019
1014
1020
if (!ipv6_get_status_flags (ip , & flag_global , & flag_reserved , & flag_private )) {
1015
- return ; /* no special block */
1021
+ return SUCCESS ; /* no special block */
1016
1022
}
1017
1023
}
1018
1024
@@ -1027,10 +1033,11 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
1027
1033
if ((flags & FILTER_FLAG_NO_RES_RANGE ) && flag_reserved == true) {
1028
1034
RETURN_VALIDATION_FAILED
1029
1035
}
1036
+ return SUCCESS ;
1030
1037
}
1031
1038
/* }}} */
1032
1039
1033
- void php_filter_validate_mac (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
1040
+ zend_result php_filter_validate_mac (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
1034
1041
{
1035
1042
const char * input = Z_STRVAL_P (value );
1036
1043
size_t input_len = Z_STRLEN_P (value );
@@ -1089,5 +1096,6 @@ void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
1089
1096
RETURN_VALIDATION_FAILED
1090
1097
}
1091
1098
}
1099
+ return SUCCESS ;
1092
1100
}
1093
1101
/* }}} */
0 commit comments