@@ -1949,6 +1949,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
19491949 sdlAttributePtr attr ;
19501950 zval * zattr , rv ;
19511951
1952+ /* Attributes can't refer to other attributes as there's nothing to attach the href to. */
1953+ HashTable * * ref_map = & SOAP_GLOBAL (ref_map );
1954+ HashTable * old_ref_map = * ref_map ;
1955+ * ref_map = NULL ;
1956+
19521957 ZEND_HASH_FOREACH_PTR (sdlType -> attributes , attr ) {
19531958 if (attr -> name ) {
19541959 zattr = get_zval_property (data , attr -> name , & rv );
@@ -1978,6 +1983,8 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
19781983 }
19791984 }
19801985 } ZEND_HASH_FOREACH_END ();
1986+
1987+ * ref_map = old_ref_map ;
19811988 }
19821989 }
19831990 if (style == SOAP_ENCODED ) {
@@ -3060,6 +3067,12 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
30603067 ret = xmlNewNode (NULL , BAD_CAST ("BOGUS" ));
30613068 xmlAddChild (parent , ret );
30623069 FIND_ZVAL_NULL (data , ret , style );
3070+
3071+ /* Literals are unique and can't refer to other references via attributes. */
3072+ HashTable * * ref_map = & SOAP_GLOBAL (ref_map );
3073+ HashTable * old_ref_map = * ref_map ;
3074+ * ref_map = NULL ;
3075+
30633076 if (Z_TYPE_P (data ) == IS_ARRAY ) {
30643077 zval * tmp ;
30653078 smart_str list = {0 };
@@ -3134,6 +3147,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
31343147 zval_ptr_dtor_str (& tmp );
31353148 }
31363149 }
3150+ * ref_map = old_ref_map ;
31373151 return ret ;
31383152}
31393153
0 commit comments