@@ -335,7 +335,7 @@ typedef struct {
335
335
#endif
336
336
} zip_options ;
337
337
338
- static bool php_zip_parse_options (HashTable * options , zip_options * opts )
338
+ static int php_zip_parse_options (HashTable * options , zip_options * opts )
339
339
/* {{{ */
340
340
{
341
341
zval * option ;
@@ -384,7 +384,7 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
384
384
if (Z_TYPE_P (option ) != IS_STRING ) {
385
385
zend_type_error ("Option \"enc_password\" must be of type string, %s given" ,
386
386
zend_zval_type_name (option ));
387
- return false ;
387
+ return -1 ;
388
388
}
389
389
opts -> enc_password = Z_STRVAL_P (option );
390
390
}
@@ -395,17 +395,17 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
395
395
if (Z_TYPE_P (option ) != IS_STRING ) {
396
396
zend_type_error ("Option \"remove_path\" must be of type string, %s given" ,
397
397
zend_zval_type_name (option ));
398
- return false ;
398
+ return -1 ;
399
399
}
400
400
401
401
if (Z_STRLEN_P (option ) == 0 ) {
402
402
zend_value_error ("Option \"remove_path\" cannot be empty" );
403
- return false ;
403
+ return -1 ;
404
404
}
405
405
406
406
if (Z_STRLEN_P (option ) >= MAXPATHLEN ) {
407
407
zend_value_error ("Option \"remove_path\" must be less than %d bytes" , MAXPATHLEN - 1 );
408
- return false ;
408
+ return -1 ;
409
409
}
410
410
opts -> remove_path_len = Z_STRLEN_P (option );
411
411
opts -> remove_path = Z_STRVAL_P (option );
@@ -415,17 +415,17 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
415
415
if (Z_TYPE_P (option ) != IS_STRING ) {
416
416
zend_type_error ("Option \"add_path\" must be of type string, %s given" ,
417
417
zend_zval_type_name (option ));
418
- return false ;
418
+ return -1 ;
419
419
}
420
420
421
421
if (Z_STRLEN_P (option ) == 0 ) {
422
422
zend_value_error ("Option \"add_path\" cannot be empty" );
423
- return false ;
423
+ return -1 ;
424
424
}
425
425
426
426
if (Z_STRLEN_P (option ) >= MAXPATHLEN ) {
427
427
zend_value_error ("Option \"add_path\" must be less than %d bytes" , MAXPATHLEN - 1 );
428
- return false ;
428
+ return -1 ;
429
429
}
430
430
opts -> add_path_len = Z_STRLEN_P (option );
431
431
opts -> add_path = Z_STRVAL_P (option );
@@ -435,12 +435,12 @@ static bool php_zip_parse_options(HashTable *options, zip_options *opts)
435
435
if (Z_TYPE_P (option ) != IS_LONG ) {
436
436
zend_type_error ("Option \"flags\" must be of type int, %s given" ,
437
437
zend_zval_type_name (option ));
438
- return false ;
438
+ return -1 ;
439
439
}
440
440
opts -> flags = Z_LVAL_P (option );
441
441
}
442
442
443
- return true ;
443
+ return 1 ;
444
444
}
445
445
/* }}} */
446
446
@@ -1700,7 +1700,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
1700
1700
zend_argument_value_error (1 , "cannot be empty" );
1701
1701
RETURN_THROWS ();
1702
1702
}
1703
- if (options && zend_hash_num_elements (options ) > 0 && (php_zip_parse_options (options , & opts ) == false )) {
1703
+ if (options && zend_hash_num_elements (options ) > 0 && (php_zip_parse_options (options , & opts ) < 0 )) {
1704
1704
RETURN_THROWS ();
1705
1705
}
1706
1706
0 commit comments