@@ -350,6 +350,11 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
350
350
351
351
if ((option = zend_hash_str_find (options , "remove_all_path" , sizeof ("remove_all_path" ) - 1 )) != NULL ) {
352
352
if (Z_TYPE_P (option ) != IS_FALSE && Z_TYPE_P (option ) != IS_TRUE ) {
353
+ if (ZEND_CALL_USES_STRICT_TYPES (EG (current_execute_data ))) {
354
+ zend_type_error ("Option \"comp_method\" must be of type bool, %s given" ,
355
+ zend_zval_type_name (option ));
356
+ return false;
357
+ }
353
358
php_error_docref (NULL , E_WARNING , "Option \"remove_all_path\" must be of type bool, %s given" ,
354
359
zend_zval_type_name (option ));
355
360
}
@@ -358,13 +363,23 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
358
363
359
364
if ((option = zend_hash_str_find (options , "comp_method" , sizeof ("comp_method" ) - 1 )) != NULL ) {
360
365
if (Z_TYPE_P (option ) != IS_LONG ) {
366
+ if (ZEND_CALL_USES_STRICT_TYPES (EG (current_execute_data ))) {
367
+ zend_type_error ("Option \"comp_method\" must be of type int, %s given" ,
368
+ zend_zval_type_name (option ));
369
+ return false;
370
+ }
361
371
php_error_docref (NULL , E_WARNING , "Option \"comp_method\" must be of type int, %s given" ,
362
372
zend_zval_type_name (option ));
363
373
}
364
374
opts -> comp_method = zval_get_long (option );
365
375
366
376
if ((option = zend_hash_str_find (options , "comp_flags" , sizeof ("comp_flags" ) - 1 )) != NULL ) {
367
377
if (Z_TYPE_P (option ) != IS_LONG ) {
378
+ if (ZEND_CALL_USES_STRICT_TYPES (EG (current_execute_data ))) {
379
+ zend_type_error ("Option \"comp_flags\" must be of type int, %s given" ,
380
+ zend_zval_type_name (option ));
381
+ return false;
382
+ }
368
383
php_error_docref (NULL , E_WARNING , "Option \"comp_flags\" must be of type int, %s given" ,
369
384
zend_zval_type_name (option ));
370
385
}
@@ -375,6 +390,11 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
375
390
#ifdef HAVE_ENCRYPTION
376
391
if ((option = zend_hash_str_find (options , "enc_method" , sizeof ("enc_method" ) - 1 )) != NULL ) {
377
392
if (Z_TYPE_P (option ) != IS_LONG ) {
393
+ if (ZEND_CALL_USES_STRICT_TYPES (EG (current_execute_data ))) {
394
+ zend_type_error ("Option \"enc_method\" must be of type int, %s given" ,
395
+ zend_zval_type_name (option ));
396
+ return false;
397
+ }
378
398
php_error_docref (NULL , E_WARNING , "Option \"enc_method\" must be of type int, %s given" ,
379
399
zend_zval_type_name (option ));
380
400
}
0 commit comments