@@ -3645,13 +3645,13 @@ static void php_image_filter_scatter(INTERNAL_FUNCTION_PARAMETERS)
3645
3645
Z_PARAM_ARRAY (hash_colors )
3646
3646
ZEND_PARSE_PARAMETERS_END ();
3647
3647
3648
- if (ZEND_SIZE_T_INT_OVFL (scatter_sub )) {
3649
- zend_argument_value_error (3 , "must not be greater than %d" , INT_MAX );
3648
+ if (scatter_sub < 0 || ZEND_SIZE_T_INT_OVFL (scatter_sub )) {
3649
+ zend_argument_value_error (3 , "must be between 0 and %d" , INT_MAX );
3650
3650
RETURN_THROWS ();
3651
3651
}
3652
3652
3653
- if (ZEND_SIZE_T_INT_OVFL (scatter_plus )) {
3654
- zend_argument_value_error (4 , "must not be greater than %d" , INT_MAX );
3653
+ if (scatter_plus < 0 || ZEND_SIZE_T_INT_OVFL (scatter_plus )) {
3654
+ zend_argument_value_error (4 , "must be between 0 and %d" , INT_MAX );
3655
3655
RETURN_THROWS ();
3656
3656
}
3657
3657
@@ -3951,7 +3951,7 @@ PHP_FUNCTION(imagescale)
3951
3951
ZEND_PARSE_PARAMETERS_END ();
3952
3952
3953
3953
if (tmp_m < GD_DEFAULT || tmp_m >= GD_METHOD_COUNT ) {
3954
- zend_argument_value_error (4 , "must be a valid mode " );
3954
+ zend_argument_value_error (4 , "must be one of the GD_* constants " );
3955
3955
RETURN_THROWS ();
3956
3956
}
3957
3957
@@ -3974,17 +3974,13 @@ PHP_FUNCTION(imagescale)
3974
3974
}
3975
3975
}
3976
3976
3977
- if (tmp_w <= 0 ) {
3978
- RETURN_FALSE ;
3979
- } else if (ZEND_SIZE_T_INT_OVFL (tmp_w )) {
3980
- zend_argument_value_error (2 , "must be lower or equal to %d" , INT_MAX );
3977
+ if (tmp_w <= 0 || ZEND_SIZE_T_INT_OVFL (tmp_w )) {
3978
+ zend_argument_value_error (2 , "must be between 1 and %d" , INT_MAX );
3981
3979
RETURN_THROWS ();
3982
3980
}
3983
3981
3984
- if (tmp_h <= 0 ) {
3985
- RETURN_FALSE ;
3986
- } else if (ZEND_SIZE_T_INT_OVFL (tmp_h )) {
3987
- zend_argument_value_error (3 , "must be lower or equal to %d" , INT_MAX );
3982
+ if (tmp_h <= 0 || ZEND_SIZE_T_INT_OVFL (tmp_h )) {
3983
+ zend_argument_value_error (3 , "must be between 1 and %d" , INT_MAX );
3988
3984
RETURN_THROWS ();
3989
3985
}
3990
3986
0 commit comments