From 71aad5da4a9b11896fb14427b1493f885488da6d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 1 Oct 2008 08:42:48 +0000 Subject: Fixed bug #43045 (SOAP encoding violation on "INF" for type double/float) --- ext/soap/php_encoding.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ext/soap/php_encoding.c') 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"); -- cgit v1.2.1