diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2006-06-15 22:44:55 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2006-06-15 22:44:55 +0000 |
commit | 9e0cedcdd6e47ca706dbedfea3f51b07ffc3f938 (patch) | |
tree | e6f1f70e1d633c3f46461ec266f9fa8f3fa869b3 | |
parent | da989ab84910f254c2f0b8e9c6d60ca3d1efbaf9 (diff) | |
download | php-git-9e0cedcdd6e47ca706dbedfea3f51b07ffc3f938.tar.gz |
Optimize the other string conversion functions here to just create raw
text nodes.
-rw-r--r-- | ext/soap/php_encoding.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 9abb704ce8..def93ffeae 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -780,7 +780,7 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) { - xmlNodePtr ret; + xmlNodePtr ret, text; unsigned char *str; int str_len; @@ -790,7 +790,8 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo if (Z_TYPE_P(data) == IS_STRING) { str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data), &str_len); - xmlNodeSetContentLen(ret, str, str_len); + text = xmlNewTextLen(str, str_len); + xmlAddChild(ret, text); efree(str); } else { zval tmp = *data; @@ -798,7 +799,8 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo zval_copy_ctor(&tmp); convert_to_string(&tmp); str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp), &str_len); - xmlNodeSetContentLen(ret, str, str_len); + text = xmlNewTextLen(str, str_len); + xmlAddChild(ret, text); efree(str); zval_dtor(&tmp); } @@ -812,7 +814,7 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) { static char hexconvtab[] = "0123456789ABCDEF"; - xmlNodePtr ret; + xmlNodePtr ret, text; unsigned char *str; zval tmp; int i, j; @@ -835,7 +837,8 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo } str[j] = '\0'; - xmlNodeSetContentLen(ret, str, Z_STRLEN_P(data) * 2 * sizeof(char)); + text = xmlNewTextLen(str, Z_STRLEN_P(data) * 2 * sizeof(char)); + xmlAddChild(ret, text); efree(str); if (data == &tmp) { zval_dtor(&tmp); |