@@ -130,8 +130,8 @@ static void tidy_doc_update_properties(PHPTidyObj *);
130
130
static void tidy_add_node_default_properties (PHPTidyObj * );
131
131
static void * php_tidy_get_opt_val (PHPTidyDoc * , TidyOption , TidyOptionType * );
132
132
static void php_tidy_create_node (INTERNAL_FUNCTION_PARAMETERS , tidy_base_nodetypes );
133
- static int _php_tidy_set_tidy_opt (TidyDoc , const char * , zval * , int arg );
134
- static int _php_tidy_apply_config_array (TidyDoc doc , const HashTable * ht_options , int arg );
133
+ static zend_result _php_tidy_set_tidy_opt (TidyDoc , const char * , zval * , uint32_t arg );
134
+ static zend_result _php_tidy_apply_config_array (TidyDoc doc , const HashTable * ht_options , uint32_t arg );
135
135
static PHP_INI_MH (php_tidy_set_clean_output );
136
136
static void php_tidy_clean_output_start (const char * name , size_t name_len );
137
137
static php_output_handler * php_tidy_output_handler_init (const char * handler_name , size_t handler_name_len , size_t chunk_size , int flags );
@@ -209,7 +209,7 @@ static void php_tidy_load_config(TidyDoc doc, const char *path)
209
209
}
210
210
}
211
211
212
- static zend_result php_tidy_apply_config (TidyDoc doc , const zend_string * str_string , const HashTable * ht_options , int arg )
212
+ static zend_result php_tidy_apply_config (TidyDoc doc , const zend_string * str_string , const HashTable * ht_options , uint32_t arg )
213
213
{
214
214
if (ht_options ) {
215
215
return _php_tidy_apply_config_array (doc , ht_options , arg );
@@ -222,7 +222,7 @@ static zend_result php_tidy_apply_config(TidyDoc doc, const zend_string *str_str
222
222
return SUCCESS ;
223
223
}
224
224
225
- static int _php_tidy_set_tidy_opt (TidyDoc doc , const char * optname , zval * value , int arg )
225
+ static zend_result _php_tidy_set_tidy_opt (TidyDoc doc , const char * optname , zval * value , uint32_t arg )
226
226
{
227
227
TidyOption opt = tidyGetOptionByName (doc , optname );
228
228
zend_string * str , * tmp_str ;
@@ -783,15 +783,16 @@ static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetyp
783
783
tidy_create_node_object (return_value , obj -> ptdoc , node );
784
784
}
785
785
786
- static int _php_tidy_apply_config_array (TidyDoc doc , const HashTable * ht_options , int arg )
786
+ static zend_result _php_tidy_apply_config_array (TidyDoc doc , const HashTable * ht_options , uint32_t arg )
787
787
{
788
788
zval * opt_val ;
789
789
zend_string * opt_name ;
790
790
791
791
if (!HT_IS_PACKED (ht_options )) {
792
792
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL (ht_options , opt_name , opt_val ) {
793
793
if (opt_name == NULL ) {
794
- continue ;
794
+ zend_argument_type_error (arg , "must be of type array with keys as string" );
795
+ return FAILURE ;
795
796
}
796
797
_php_tidy_set_tidy_opt (doc , ZSTR_VAL (opt_name ), opt_val , arg );
797
798
} ZEND_HASH_FOREACH_END ();
0 commit comments