@@ -195,7 +195,7 @@ static bool php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret
195195}
196196/* }}} */
197197
198- void php_filter_int (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
198+ zend_result php_filter_int (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
199199{
200200 zval * option_val ;
201201 zend_long min_range , max_range , option_flags ;
@@ -266,12 +266,12 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
266266 } else {
267267 zval_ptr_dtor (value );
268268 ZVAL_LONG (value , ctx_value );
269- return ;
270269 }
270+ return SUCCESS ;
271271}
272272/* }}} */
273273
274- void php_filter_boolean (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
274+ zend_result php_filter_boolean (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
275275{
276276 const char * str = Z_STRVAL_P (value );
277277 size_t len = Z_STRLEN_P (value );
@@ -337,10 +337,11 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
337337 zval_ptr_dtor (value );
338338 ZVAL_BOOL (value , ret );
339339 }
340+ return SUCCESS ;
340341}
341342/* }}} */
342343
343- void php_filter_float (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
344+ zend_result php_filter_float (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
344345{
345346 size_t len ;
346347 const char * str , * end ;
@@ -467,10 +468,11 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
467468 RETURN_VALIDATION_FAILED
468469 }
469470 efree (num );
471+ return SUCCESS ;
470472}
471473/* }}} */
472474
473- void php_filter_validate_regexp (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
475+ zend_result php_filter_validate_regexp (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
474476{
475477 zval * option_val ;
476478 zend_string * regexp ;
@@ -503,6 +505,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
503505 if (rc < 0 ) {
504506 RETURN_VALIDATION_FAILED
505507 }
508+ return SUCCESS ;
506509}
507510
508511static 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
557560}
558561/* }}} */
559562
560- void php_filter_validate_domain (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
563+ zend_result php_filter_validate_domain (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
561564{
562565 if (!php_filter_validate_domain_ex (Z_STR_P (value ), flags )) {
563566 RETURN_VALIDATION_FAILED
564567 }
568+ return SUCCESS ;
565569}
566570/* }}} */
567571
@@ -589,7 +593,7 @@ static bool php_filter_is_valid_ipv6_hostname(const zend_string *s)
589593 return * ZSTR_VAL (s ) == '[' && * t == ']' && _php_filter_validate_ipv6 (ZSTR_VAL (s ) + 1 , ZSTR_LEN (s ) - 2 , NULL );
590594}
591595
592- void php_filter_validate_url (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
596+ zend_result php_filter_validate_url (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
593597{
594598 php_url * url ;
595599 size_t old_len = Z_STRLEN_P (value );
@@ -646,10 +650,11 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
646650 }
647651
648652 php_url_free (url );
653+ return SUCCESS ;
649654}
650655/* }}} */
651656
652- void php_filter_validate_email (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
657+ zend_result php_filter_validate_email (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
653658{
654659 /*
655660 * 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) /* {{{ */
715720 if (rc < 0 ) {
716721 RETURN_VALIDATION_FAILED
717722 }
723+ return SUCCESS ;
718724
719725}
720726/* }}} */
@@ -975,7 +981,7 @@ static bool ipv6_get_status_flags(const int ip[8], bool *global, bool *reserved,
975981 * to throw out reserved ranges; multicast ranges... etc. If both allow_ipv4
976982 * and allow_ipv6 flags flag are used, then the first dot or colon determine
977983 * 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 ) /* {{{ */
979985{
980986 int ip [8 ];
981987 int mode ;
@@ -1003,7 +1009,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
10031009 }
10041010
10051011 if (!ipv4_get_status_flags (ip , & flag_global , & flag_reserved , & flag_private )) {
1006- return ; /* no special block */
1012+ return SUCCESS ; /* no special block */
10071013 }
10081014 }
10091015 else if (mode == FORMAT_IPV6 ) {
@@ -1012,7 +1018,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
10121018 }
10131019
10141020 if (!ipv6_get_status_flags (ip , & flag_global , & flag_reserved , & flag_private )) {
1015- return ; /* no special block */
1021+ return SUCCESS ; /* no special block */
10161022 }
10171023 }
10181024
@@ -1027,10 +1033,11 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
10271033 if ((flags & FILTER_FLAG_NO_RES_RANGE ) && flag_reserved == true) {
10281034 RETURN_VALIDATION_FAILED
10291035 }
1036+ return SUCCESS ;
10301037}
10311038/* }}} */
10321039
1033- void php_filter_validate_mac (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
1040+ zend_result php_filter_validate_mac (PHP_INPUT_FILTER_PARAM_DECL ) /* {{{ */
10341041{
10351042 const char * input = Z_STRVAL_P (value );
10361043 size_t input_len = Z_STRLEN_P (value );
@@ -1089,5 +1096,6 @@ void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
10891096 RETURN_VALIDATION_FAILED
10901097 }
10911098 }
1099+ return SUCCESS ;
10921100}
10931101/* }}} */
0 commit comments