summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/soap/php_encoding.c8
-rw-r--r--ext/soap/php_http.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 4138b5acb0..e33675125b 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1148,13 +1148,17 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlNodePtr property;
zval **zprop;
char *str_key;
+ ulong index;
+ int key_type;
- zend_hash_get_current_key(prop, &str_key, NULL, FALSE);
+ key_type = zend_hash_get_current_key(prop, &str_key, &index, FALSE);
zend_hash_get_current_data(prop, (void **)&zprop);
property = master_to_xml(get_conversion((*zprop)->type), (*zprop), style, xmlParam);
- xmlNodeSetName(property, str_key);
+ if (key_type == HASH_KEY_IS_STRING) {
+ xmlNodeSetName(property, str_key);
+ }
zend_hash_move_forward(prop);
}
}
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 8c8d24e55f..df6355d240 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -224,9 +224,9 @@ int send_http_soap_request(zval *this_ptr, xmlDoc *doc, char *location, char *so
}
use_ssl = 0;
- if (strcmp(phpurl->scheme, "https") == 0) {
+ if (phpurl->scheme != NULL && strcmp(phpurl->scheme, "https") == 0) {
use_ssl = 1;
- } else if (strcmp(phpurl->scheme, "http") != 0) {
+ } else if (phpurl->scheme == NULL || strcmp(phpurl->scheme, "http") != 0) {
xmlFree(buf);
php_url_free(phpurl);
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC);