@@ -426,7 +426,7 @@ static PHP_METHOD(MongoDB_Driver_ClientEncryption, rewrapManyDataKey)
426
426
}
427
427
428
428
if (options && php_array_existsc (options , "masterKey" )) {
429
- zval * zmasterkey = php_array_fetchc (options , "masterKey" );
429
+ zval * zmasterkey = php_array_fetchc_deref (options , "masterKey" );
430
430
431
431
if (Z_TYPE_P (zmasterkey ) != IS_OBJECT && Z_TYPE_P (zmasterkey ) != IS_ARRAY ) {
432
432
phongo_throw_exception (PHONGO_ERROR_INVALID_ARGUMENT , "Expected \"masterKey\" option to be array or object, %s given" , PHONGO_ZVAL_CLASS_OR_TYPE_NAME_P (zmasterkey ));
@@ -549,7 +549,7 @@ static mongoc_client_encryption_opts_t* phongo_clientencryption_opts_from_zval(z
549
549
}
550
550
551
551
if (php_array_existsc (options , "keyVaultClient" )) {
552
- zval * key_vault_client = php_array_fetch (options , "keyVaultClient" );
552
+ zval * key_vault_client = php_array_fetchc_deref (options , "keyVaultClient" );
553
553
554
554
if (Z_TYPE_P (key_vault_client ) != IS_OBJECT || !instanceof_function (Z_OBJCE_P (key_vault_client ), php_phongo_manager_ce )) {
555
555
phongo_throw_exception (PHONGO_ERROR_INVALID_ARGUMENT , "Expected \"keyVaultClient\" option to be %s, %s given" , ZSTR_VAL (php_phongo_manager_ce -> name ), PHONGO_ZVAL_CLASS_OR_TYPE_NAME_P (key_vault_client ));
@@ -597,7 +597,7 @@ static mongoc_client_encryption_opts_t* phongo_clientencryption_opts_from_zval(z
597
597
}
598
598
599
599
if (php_array_existsc (options , "kmsProviders" )) {
600
- zval * kms_providers = php_array_fetchc (options , "kmsProviders" );
600
+ zval * kms_providers = php_array_fetchc_deref (options , "kmsProviders" );
601
601
bson_t bson_providers = BSON_INITIALIZER ;
602
602
603
603
if (Z_TYPE_P (kms_providers ) != IS_ARRAY && Z_TYPE_P (kms_providers ) != IS_OBJECT ) {
@@ -615,7 +615,7 @@ static mongoc_client_encryption_opts_t* phongo_clientencryption_opts_from_zval(z
615
615
}
616
616
617
617
if (php_array_existsc (options , "tlsOptions" )) {
618
- zval * tls_options = php_array_fetchc (options , "tlsOptions" );
618
+ zval * tls_options = php_array_fetchc_deref (options , "tlsOptions" );
619
619
bson_t bson_options = BSON_INITIALIZER ;
620
620
621
621
if (Z_TYPE_P (tls_options ) != IS_ARRAY && Z_TYPE_P (tls_options ) != IS_OBJECT ) {
@@ -706,7 +706,7 @@ static mongoc_client_encryption_datakey_opts_t* phongo_clientencryption_datakey_
706
706
}
707
707
708
708
if (php_array_existsc (options , "keyAltNames" )) {
709
- zval * zkeyaltnames = php_array_fetchc (options , "keyAltNames" );
709
+ zval * zkeyaltnames = php_array_fetchc_deref (options , "keyAltNames" );
710
710
HashTable * ht_data ;
711
711
uint32_t keyaltnames_count ;
712
712
char * * keyaltnames ;
@@ -768,7 +768,7 @@ static mongoc_client_encryption_datakey_opts_t* phongo_clientencryption_datakey_
768
768
}
769
769
770
770
if (php_array_existsc (options , "keyMaterial" )) {
771
- zval * keyMaterial = php_array_fetchc (options , "keyMaterial" );
771
+ zval * keyMaterial = php_array_fetchc_deref (options , "keyMaterial" );
772
772
773
773
if (Z_TYPE_P (keyMaterial ) != IS_OBJECT || !instanceof_function (Z_OBJCE_P (keyMaterial ), php_phongo_binary_ce )) {
774
774
phongo_throw_exception (PHONGO_ERROR_INVALID_ARGUMENT , "Expected \"keyMaterial\" option to be %s, %s given" , ZSTR_VAL (php_phongo_binary_ce -> name ), PHONGO_ZVAL_CLASS_OR_TYPE_NAME_P (keyMaterial ));
@@ -779,7 +779,7 @@ static mongoc_client_encryption_datakey_opts_t* phongo_clientencryption_datakey_
779
779
}
780
780
781
781
if (php_array_existsc (options , "masterKey" )) {
782
- zval * zmasterkey = php_array_fetchc (options , "masterKey" );
782
+ zval * zmasterkey = php_array_fetchc_deref (options , "masterKey" );
783
783
bson_t masterkey = BSON_INITIALIZER ;
784
784
785
785
if (Z_TYPE_P (zmasterkey ) != IS_OBJECT && Z_TYPE_P (zmasterkey ) != IS_ARRAY ) {
@@ -931,7 +931,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
931
931
}
932
932
933
933
if (php_array_existsc (options , "contentionFactor" )) {
934
- mongoc_client_encryption_encrypt_opts_set_contention_factor (opts , php_array_fetch_long (options , "contentionFactor" ));
934
+ mongoc_client_encryption_encrypt_opts_set_contention_factor (opts , php_array_fetchc_long (options , "contentionFactor" ));
935
935
}
936
936
937
937
if (php_array_existsc (options , "keyId" )) {
@@ -953,7 +953,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
953
953
int plen ;
954
954
zend_bool pfree ;
955
955
956
- keyaltname = php_array_fetch_string (options , "keyAltName" , & plen , & pfree );
956
+ keyaltname = php_array_fetchc_string (options , "keyAltName" , & plen , & pfree );
957
957
mongoc_client_encryption_encrypt_opts_set_keyaltname (opts , keyaltname );
958
958
959
959
if (pfree ) {
@@ -966,7 +966,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
966
966
int plen ;
967
967
zend_bool pfree ;
968
968
969
- algorithm = php_array_fetch_string (options , "algorithm" , & plen , & pfree );
969
+ algorithm = php_array_fetchc_string (options , "algorithm" , & plen , & pfree );
970
970
mongoc_client_encryption_encrypt_opts_set_algorithm (opts , algorithm );
971
971
972
972
if (pfree ) {
@@ -979,7 +979,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
979
979
int plen ;
980
980
zend_bool pfree ;
981
981
982
- querytype = php_array_fetch_string (options , "queryType" , & plen , & pfree );
982
+ querytype = php_array_fetchc_string (options , "queryType" , & plen , & pfree );
983
983
mongoc_client_encryption_encrypt_opts_set_query_type (opts , querytype );
984
984
985
985
if (pfree ) {
@@ -990,7 +990,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
990
990
if (php_array_existsc (options , "rangeOpts" )) {
991
991
mongoc_client_encryption_encrypt_range_opts_t * range_opts ;
992
992
993
- range_opts = phongo_clientencryption_encrypt_range_opts_from_zval (php_array_fetchc (options , "rangeOpts" ));
993
+ range_opts = phongo_clientencryption_encrypt_range_opts_from_zval (php_array_fetchc_deref (options , "rangeOpts" ));
994
994
995
995
if (!range_opts ) {
996
996
/* Exception already thrown */
0 commit comments