@@ -1924,6 +1924,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
19241924 sdlAttributePtr attr ;
19251925 zval * zattr , rv ;
19261926
1927+ /* Attributes can't refer to other attributes as there's nothing to attach the href to. */
1928+ HashTable * * ref_map = & SOAP_GLOBAL (ref_map );
1929+ HashTable * old_ref_map = * ref_map ;
1930+ * ref_map = NULL ;
1931+
19271932 ZEND_HASH_FOREACH_PTR (sdlType -> attributes , attr ) {
19281933 if (attr -> name ) {
19291934 zattr = get_zval_property (data , attr -> name , & rv );
@@ -1953,6 +1958,8 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
19531958 }
19541959 }
19551960 } ZEND_HASH_FOREACH_END ();
1961+
1962+ * ref_map = old_ref_map ;
19561963 }
19571964 }
19581965 if (style == SOAP_ENCODED ) {
@@ -3055,6 +3062,12 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
30553062 ret = xmlNewDocNode (parent -> doc , NULL , BAD_CAST ("BOGUS" ), NULL );
30563063 xmlAddChild (parent , ret );
30573064 FIND_ZVAL_NULL (data , ret , style );
3065+
3066+ /* Literals are unique and can't refer to other references via attributes. */
3067+ HashTable * * ref_map = & SOAP_GLOBAL (ref_map );
3068+ HashTable * old_ref_map = * ref_map ;
3069+ * ref_map = NULL ;
3070+
30583071 if (Z_TYPE_P (data ) == IS_ARRAY ) {
30593072 zval * tmp ;
30603073 smart_str list = {0 };
@@ -3129,6 +3142,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
31293142 zval_ptr_dtor_str (& tmp );
31303143 }
31313144 }
3145+ * ref_map = old_ref_map ;
31323146 return ret ;
31333147}
31343148
0 commit comments