diff options
author | Dmitry Stogov <dmitry@php.net> | 2008-10-01 08:42:48 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2008-10-01 08:42:48 +0000 |
commit | 71aad5da4a9b11896fb14427b1493f885488da6d (patch) | |
tree | 687ec030c6cb7d3a37ee30b9dd90068881230ed3 /ext/soap/php_encoding.c | |
parent | f656c6fc70dedb3a2b62e9604396a1b82e32314c (diff) | |
download | php-git-71aad5da4a9b11896fb14427b1493f885488da6d.tar.gz |
Fixed bug #43045 (SOAP encoding violation on "INF" for type double/float)
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r-- | ext/soap/php_encoding.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index b6225270e8..ffc23457be 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1015,7 +1015,15 @@ static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data) Z_DVAL_P(ret) = dval; break; default: - soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); + if (strncasecmp((char*)data->children->content, "NaN", sizeof("NaN")-1) == 0) { + ZVAL_DOUBLE(ret, php_get_nan()); + } else if (strncasecmp((char*)data->children->content, "INF", sizeof("INF")-1) == 0) { + ZVAL_DOUBLE(ret, php_get_inf()); + } else if (strncasecmp((char*)data->children->content, "-INF", sizeof("-INF")-1) == 0) { + ZVAL_DOUBLE(ret, -php_get_inf()); + } else { + soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); + } } } else { soap_error0(E_ERROR, "Encoding: Violation of encoding rules"); |