@@ -814,7 +814,7 @@ static int append_key_value(smart_str* loc_name, HashTable* hash_arr, char* key_
814814{
815815 zval * ele_value ;
816816
817- if ((ele_value = zend_hash_str_find (hash_arr , key_name , strlen (key_name ))) != NULL ) {
817+ if ((ele_value = zend_hash_str_find_deref (hash_arr , key_name , strlen (key_name ))) != NULL ) {
818818 if (Z_TYPE_P (ele_value )!= IS_STRING ){
819819 /* element value is not a string */
820820 return FAILURE ;
@@ -857,7 +857,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
857857 int isFirstSubtag = 0 ;
858858
859859 /* Variant/ Extlang/Private etc. */
860- if ((ele_value = zend_hash_str_find ( hash_arr , key_name , strlen (key_name ))) != NULL ) {
860+ if ((ele_value = zend_hash_str_find_deref ( hash_arr , key_name , strlen (key_name ))) != NULL ) {
861861 if ( Z_TYPE_P (ele_value ) == IS_STRING ){
862862 add_prefix ( loc_name , key_name );
863863
@@ -869,6 +869,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
869869 zval * data ;
870870
871871 ZEND_HASH_FOREACH_VAL (arr , data ) {
872+ ZVAL_DEREF (data );
872873 if (Z_TYPE_P (data ) != IS_STRING ) {
873874 return FAILURE ;
874875 }
@@ -900,7 +901,7 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
900901 isFirstSubtag = 0 ;
901902 for ( i = 0 ; i < max_value ; i ++ ){
902903 snprintf ( cur_key_name , 30 , "%s%d" , key_name , i );
903- if ((ele_value = zend_hash_str_find ( hash_arr , cur_key_name , strlen (cur_key_name ))) != NULL ) {
904+ if ((ele_value = zend_hash_str_find_deref ( hash_arr , cur_key_name , strlen (cur_key_name ))) != NULL ) {
904905 if ( Z_TYPE_P (ele_value )!= IS_STRING ){
905906 /* variant is not a string */
906907 return FAILURE ;
@@ -1437,6 +1438,7 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr,
14371438
14381439 char * * cur_arr = ecalloc (zend_hash_num_elements (hash_arr )* 2 , sizeof (char * ));
14391440 ZEND_HASH_FOREACH_VAL (hash_arr , ele_value ) {
1441+ ZVAL_DEREF (ele_value );
14401442 /* convert the array to lowercase , also replace hyphens with the underscore and store it in cur_arr */
14411443 if (Z_TYPE_P (ele_value )!= IS_STRING ) {
14421444 /* element value is not a string */
0 commit comments