diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index ec9f8285f10..b59fd67c53c 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -448,21 +448,21 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml zend_binary_strncasecmp(ce->name, ce->name_length, Z_STRVAL_PP(tmp), ce->name_length, ce->name_length) == 0 && zend_hash_get_current_key_ex(SOAP_GLOBAL(class_map), &type_name, &type_len, &idx, 0, &pos) == HASH_KEY_IS_STRING) { - /* TODO: namespace isn't stored */ - encodePtr enc = NULL; - if (SOAP_GLOBAL(sdl)) { - enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)->target_ns, type_name); - if (!enc) { - enc = find_encoder_by_type_name(SOAP_GLOBAL(sdl), type_name); - } - } - if (enc) { - if (encode != enc && style == SOAP_LITERAL) { + /* TODO: namespace isn't stored */ + encodePtr enc = NULL; + if (SOAP_GLOBAL(sdl)) { + enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)->target_ns, type_name); + if (!enc) { + enc = find_encoder_by_type_name(SOAP_GLOBAL(sdl), type_name); + } + } + if (enc) { + if (encode != enc && style == SOAP_LITERAL) { add_type = 1; - } - encode = enc; - } - break; + } + encode = enc; + } + break; } } }