summaryrefslogtreecommitdiff
path: root/ext/soap/php_encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r--ext/soap/php_encoding.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index af7a8e1f1..e9a797327 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.103.2.21.2.33 2007/05/04 06:19:34 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.21.2.35 2007/08/22 14:18:09 dmitry Exp $ */
#include <time.h>
@@ -297,6 +297,10 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
}
if (attr) {
id = (char*)attr->children->content;
+ smart_str_appendc(&prefix, '#');
+ smart_str_appends(&prefix, id);
+ smart_str_0(&prefix);
+ id = prefix.c;
} else {
SOAP_GLOBAL(cur_uniq_ref)++;
smart_str_appendl(&prefix, "#ref", 4);
@@ -310,6 +314,10 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
attr = get_attribute_ex(attr, "id", SOAP_1_2_ENC_NAMESPACE);
if (attr) {
id = (char*)attr->children->content;
+ smart_str_appendc(&prefix, '#');
+ smart_str_appends(&prefix, id);
+ smart_str_0(&prefix);
+ id = prefix.c;
} else {
SOAP_GLOBAL(cur_uniq_ref)++;
smart_str_appendl(&prefix, "#ref", 4);
@@ -439,7 +447,10 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
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 = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)->target_ns, type_name);
+ encodePtr enc = NULL;
+ if (SOAP_GLOBAL(sdl)) {
+ enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)->target_ns, type_name);
+ }
if (enc) {
encode = enc;
} else if (SOAP_GLOBAL(sdl)) {