@@ -426,7 +426,7 @@ static PHP_METHOD(MongoDB_Driver_ClientEncryption, rewrapManyDataKey)
426426 }
427427
428428 if (options && php_array_existsc (options , "masterKey" )) {
429- zval * zmasterkey = php_array_fetchc (options , "masterKey" );
429+ zval * zmasterkey = php_array_fetchc_deref (options , "masterKey" );
430430
431431 if (Z_TYPE_P (zmasterkey ) != IS_OBJECT && Z_TYPE_P (zmasterkey ) != IS_ARRAY ) {
432432 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
549549 }
550550
551551 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" );
553553
554554 if (Z_TYPE_P (key_vault_client ) != IS_OBJECT || !instanceof_function (Z_OBJCE_P (key_vault_client ), php_phongo_manager_ce )) {
555555 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
597597 }
598598
599599 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" );
601601 bson_t bson_providers = BSON_INITIALIZER ;
602602
603603 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
615615 }
616616
617617 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" );
619619 bson_t bson_options = BSON_INITIALIZER ;
620620
621621 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_
706706 }
707707
708708 if (php_array_existsc (options , "keyAltNames" )) {
709- zval * zkeyaltnames = php_array_fetchc (options , "keyAltNames" );
709+ zval * zkeyaltnames = php_array_fetchc_deref (options , "keyAltNames" );
710710 HashTable * ht_data ;
711711 uint32_t keyaltnames_count ;
712712 char * * keyaltnames ;
@@ -768,7 +768,7 @@ static mongoc_client_encryption_datakey_opts_t* phongo_clientencryption_datakey_
768768 }
769769
770770 if (php_array_existsc (options , "keyMaterial" )) {
771- zval * keyMaterial = php_array_fetchc (options , "keyMaterial" );
771+ zval * keyMaterial = php_array_fetchc_deref (options , "keyMaterial" );
772772
773773 if (Z_TYPE_P (keyMaterial ) != IS_OBJECT || !instanceof_function (Z_OBJCE_P (keyMaterial ), php_phongo_binary_ce )) {
774774 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_
779779 }
780780
781781 if (php_array_existsc (options , "masterKey" )) {
782- zval * zmasterkey = php_array_fetchc (options , "masterKey" );
782+ zval * zmasterkey = php_array_fetchc_deref (options , "masterKey" );
783783 bson_t masterkey = BSON_INITIALIZER ;
784784
785785 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_
931931 }
932932
933933 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" ));
935935 }
936936
937937 if (php_array_existsc (options , "keyId" )) {
@@ -953,7 +953,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
953953 int plen ;
954954 zend_bool pfree ;
955955
956- keyaltname = php_array_fetch_string (options , "keyAltName" , & plen , & pfree );
956+ keyaltname = php_array_fetchc_string (options , "keyAltName" , & plen , & pfree );
957957 mongoc_client_encryption_encrypt_opts_set_keyaltname (opts , keyaltname );
958958
959959 if (pfree ) {
@@ -966,7 +966,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
966966 int plen ;
967967 zend_bool pfree ;
968968
969- algorithm = php_array_fetch_string (options , "algorithm" , & plen , & pfree );
969+ algorithm = php_array_fetchc_string (options , "algorithm" , & plen , & pfree );
970970 mongoc_client_encryption_encrypt_opts_set_algorithm (opts , algorithm );
971971
972972 if (pfree ) {
@@ -979,7 +979,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
979979 int plen ;
980980 zend_bool pfree ;
981981
982- querytype = php_array_fetch_string (options , "queryType" , & plen , & pfree );
982+ querytype = php_array_fetchc_string (options , "queryType" , & plen , & pfree );
983983 mongoc_client_encryption_encrypt_opts_set_query_type (opts , querytype );
984984
985985 if (pfree ) {
@@ -990,7 +990,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
990990 if (php_array_existsc (options , "rangeOpts" )) {
991991 mongoc_client_encryption_encrypt_range_opts_t * range_opts ;
992992
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" ));
994994
995995 if (!range_opts ) {
996996 /* Exception already thrown */
0 commit comments