@@ -334,7 +334,7 @@ typedef struct {
334
334
#endif
335
335
} zip_options ;
336
336
337
- static int php_zip_parse_options (zval * options , zip_options * opts )
337
+ static int php_zip_parse_options (HashTable * options , zip_options * opts )
338
338
/* {{{ */
339
339
{
340
340
zval * option ;
@@ -347,23 +347,23 @@ static int php_zip_parse_options(zval *options, zip_options *opts)
347
347
opts -> enc_method = -1 ; /* -1 to not change default */
348
348
#endif
349
349
350
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "remove_all_path" , sizeof ("remove_all_path" ) - 1 )) != NULL ) {
350
+ if ((option = zend_hash_str_find (options , "remove_all_path" , sizeof ("remove_all_path" ) - 1 )) != NULL ) {
351
351
opts -> remove_all_path = zval_get_long (option );
352
352
}
353
353
354
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "comp_method" , sizeof ("comp_method" ) - 1 )) != NULL ) {
354
+ if ((option = zend_hash_str_find (options , "comp_method" , sizeof ("comp_method" ) - 1 )) != NULL ) {
355
355
opts -> comp_method = zval_get_long (option );
356
356
357
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "comp_flags" , sizeof ("comp_flags" ) - 1 )) != NULL ) {
357
+ if ((option = zend_hash_str_find (options , "comp_flags" , sizeof ("comp_flags" ) - 1 )) != NULL ) {
358
358
opts -> comp_flags = zval_get_long (option );
359
359
}
360
360
}
361
361
362
362
#ifdef HAVE_ENCRYPTION
363
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "enc_method" , sizeof ("enc_method" ) - 1 )) != NULL ) {
363
+ if ((option = zend_hash_str_find (options , "enc_method" , sizeof ("enc_method" ) - 1 )) != NULL ) {
364
364
opts -> enc_method = zval_get_long (option );
365
365
366
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "enc_password" , sizeof ("enc_password" ) - 1 )) != NULL ) {
366
+ if ((option = zend_hash_str_find (options , "enc_password" , sizeof ("enc_password" ) - 1 )) != NULL ) {
367
367
if (Z_TYPE_P (option ) != IS_STRING ) {
368
368
php_error_docref (NULL , E_WARNING , "enc_password option expected to be a string" );
369
369
return -1 ;
@@ -373,7 +373,7 @@ static int php_zip_parse_options(zval *options, zip_options *opts)
373
373
}
374
374
#endif
375
375
376
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "remove_path" , sizeof ("remove_path" ) - 1 )) != NULL ) {
376
+ if ((option = zend_hash_str_find (options , "remove_path" , sizeof ("remove_path" ) - 1 )) != NULL ) {
377
377
if (Z_TYPE_P (option ) != IS_STRING ) {
378
378
php_error_docref (NULL , E_WARNING , "remove_path option expected to be a string" );
379
379
return -1 ;
@@ -393,7 +393,7 @@ static int php_zip_parse_options(zval *options, zip_options *opts)
393
393
opts -> remove_path = Z_STRVAL_P (option );
394
394
}
395
395
396
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "add_path" , sizeof ("add_path" ) - 1 )) != NULL ) {
396
+ if ((option = zend_hash_str_find (options , "add_path" , sizeof ("add_path" ) - 1 )) != NULL ) {
397
397
if (Z_TYPE_P (option ) != IS_STRING ) {
398
398
php_error_docref (NULL , E_WARNING , "add_path option expected to be a string" );
399
399
return -1 ;
@@ -413,7 +413,7 @@ static int php_zip_parse_options(zval *options, zip_options *opts)
413
413
opts -> add_path = Z_STRVAL_P (option );
414
414
}
415
415
416
- if ((option = zend_hash_str_find (Z_ARRVAL_P ( options ) , "flags" , sizeof ("flags" ) - 1 )) != NULL ) {
416
+ if ((option = zend_hash_str_find (options , "flags" , sizeof ("flags" ) - 1 )) != NULL ) {
417
417
if (Z_TYPE_P (option ) != IS_LONG ) {
418
418
php_error_docref (NULL , E_WARNING , "flags option expected to be a integer" );
419
419
return -1 ;
@@ -1658,19 +1658,19 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
1658
1658
char * path = "." ;
1659
1659
size_t path_len = 1 ;
1660
1660
zend_long glob_flags = 0 ;
1661
- zval * options = NULL ;
1661
+ HashTable * options = NULL ;
1662
1662
zip_options opts ;
1663
1663
int found ;
1664
1664
zend_string * pattern ;
1665
1665
1666
1666
/* 1 == glob, 2 == pcre */
1667
1667
if (type == 1 ) {
1668
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "P|la " ,
1668
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "P|lh " ,
1669
1669
& pattern , & glob_flags , & options ) == FAILURE ) {
1670
1670
RETURN_THROWS ();
1671
1671
}
1672
1672
} else {
1673
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "P|sa " ,
1673
+ if (zend_parse_parameters (ZEND_NUM_ARGS (), "P|sh " ,
1674
1674
& pattern , & path , & path_len , & options ) == FAILURE ) {
1675
1675
RETURN_THROWS ();
1676
1676
}
@@ -1680,7 +1680,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
1680
1680
php_error_docref (NULL , E_NOTICE , "Empty string as pattern" );
1681
1681
RETURN_FALSE ;
1682
1682
}
1683
- if (options && zend_hash_num_elements (Z_ARRVAL_P ( options ) ) > 0 && (php_zip_parse_options (options , & opts ) < 0 )) {
1683
+ if (options && zend_hash_num_elements (options ) > 0 && (php_zip_parse_options (options , & opts ) < 0 )) {
1684
1684
RETURN_FALSE ;
1685
1685
}
1686
1686
0 commit comments