@@ -487,8 +487,8 @@ static zval *php_filter_get_storage(zend_long arg)/* {{{ */
487
487
array_ptr = !Z_ISUNDEF (IF_G (env_array )) ? & IF_G (env_array ) : & PG (http_globals )[TRACK_VARS_ENV ];
488
488
break ;
489
489
default :
490
- php_error_docref ( NULL , E_WARNING , "Unknown source " );
491
- break ;
490
+ zend_argument_value_error ( 1 , "must be an INPUT_* constant " );
491
+ return NULL ;
492
492
}
493
493
494
494
if (array_ptr && Z_TYPE_P (array_ptr ) != IS_ARRAY ) {
@@ -512,6 +512,9 @@ PHP_FUNCTION(filter_has_var)
512
512
}
513
513
514
514
array_ptr = php_filter_get_storage (arg );
515
+ if (EG (exception )) {
516
+ RETURN_THROWS ();
517
+ }
515
518
516
519
if (array_ptr && zend_hash_exists (Z_ARRVAL_P (array_ptr ), var )) {
517
520
RETURN_TRUE ;
@@ -614,14 +617,12 @@ static void php_filter_array_handler(zval *input, zval *op, zval *return_value,
614
617
615
618
ZEND_HASH_FOREACH_STR_KEY_VAL (Z_ARRVAL_P (op ), arg_key , arg_elm ) {
616
619
if (arg_key == NULL ) {
617
- php_error_docref (NULL , E_WARNING , "Numeric keys are not allowed in the definition array" );
618
- zval_ptr_dtor (return_value );
619
- RETURN_FALSE ;
620
+ zend_argument_type_error (2 , "must contain only string keys" );
621
+ RETURN_THROWS ();
620
622
}
621
623
if (ZSTR_LEN (arg_key ) == 0 ) {
622
- php_error_docref (NULL , E_WARNING , "Empty keys are not allowed in the definition array" );
623
- zval_ptr_dtor (return_value );
624
- RETURN_FALSE ;
624
+ zend_argument_value_error (2 , "cannot contain empty keys" );
625
+ RETURN_THROWS ();
625
626
}
626
627
if ((tmp = zend_hash_find (Z_ARRVAL_P (input ), arg_key )) == NULL ) {
627
628
if (add_empty ) {
@@ -658,6 +659,9 @@ PHP_FUNCTION(filter_input)
658
659
}
659
660
660
661
input = php_filter_get_storage (fetch_from );
662
+ if (EG (exception )) {
663
+ RETURN_THROWS ();
664
+ }
661
665
662
666
if (!input || (tmp = zend_hash_find (Z_ARRVAL_P (input ), var )) == NULL ) {
663
667
zend_long filter_flags = 0 ;
@@ -731,6 +735,9 @@ PHP_FUNCTION(filter_input_array)
731
735
}
732
736
733
737
array_input = php_filter_get_storage (fetch_from );
738
+ if (EG (exception )) {
739
+ RETURN_THROWS ();
740
+ }
734
741
735
742
if (!array_input ) {
736
743
zend_long filter_flags = 0 ;
0 commit comments