diff options
author | Dmitry Stogov <dmitry@php.net> | 2004-02-11 13:53:50 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2004-02-11 13:53:50 +0000 |
commit | 6096b09159b181e938380cbe18e70b4297942209 (patch) | |
tree | 9c5b0f3a86c338fed539c5cfdbe3a9412130002f /ext/soap/php_encoding.c | |
parent | 75390796bed8ffe6e66ebd3e555cd25bdeab6571 (diff) | |
download | php-git-6096b09159b181e938380cbe18e70b4297942209.tar.gz |
Now SoapClient uses excptions as default method for error reporting
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r-- | ext/soap/php_encoding.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 9686048dbb..08acbfbfd6 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2363,26 +2363,33 @@ void encode_reset_ns() encodePtr get_conversion_ex(HashTable *encoding, int encode) { - encodePtr *enc; + encodePtr *enc = NULL; TSRMLS_FETCH(); if (zend_hash_index_find(encoding, encode, (void **)&enc) == FAILURE) { - php_error(E_ERROR, "SOAP-ERROR: Encoding: Cannot find encoding"); - } - - if (SOAP_GLOBAL(overrides)) { - smart_str nscat = {0}; - - smart_str_appendl(&nscat, (*enc)->details.ns, strlen((*enc)->details.ns)); - smart_str_appendc(&nscat, ':'); - smart_str_appendl(&nscat, (*enc)->details.type_str, strlen((*enc)->details.type_str)); - smart_str_0(&nscat); - - zend_hash_find(SOAP_GLOBAL(overrides), nscat.c, nscat.len + 1, (void **)&enc); - smart_str_free(&nscat); + if (SOAP_GLOBAL(overrides)) { + smart_str nscat = {0}; + + smart_str_appendl(&nscat, (*enc)->details.ns, strlen((*enc)->details.ns)); + smart_str_appendc(&nscat, ':'); + smart_str_appendl(&nscat, (*enc)->details.type_str, strlen((*enc)->details.type_str)); + smart_str_0(&nscat); + + if (zend_hash_find(SOAP_GLOBAL(overrides), nscat.c, nscat.len + 1, (void **)&enc) == FAILURE) { + smart_str_free(&nscat); + php_error(E_ERROR, "SOAP-ERROR: Encoding: Cannot find encoding"); + return NULL; + } else { + smart_str_free(&nscat); + return *enc; + } + } else { + php_error(E_ERROR, "SOAP-ERROR: Encoding: Cannot find encoding"); + return NULL; + } + } else { + return *enc; } - - return *enc; } encodePtr get_conversion_from_href_type_ex(HashTable *encoding, const char *type, int len) |