diff options
author | Dmitry Stogov <dmitry@php.net> | 2005-03-05 13:27:13 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2005-03-05 13:27:13 +0000 |
commit | eff0d6524057c5fc44d8f4f458f0271d6767d8bf (patch) | |
tree | ffd1986ded85ba12833a9e7fb496d05a646a9690 /ext/soap/php_encoding.c | |
parent | e4ce3e36efd5d2b9e9be66767db06c14d690b32a (diff) | |
download | php-git-eff0d6524057c5fc44d8f4f458f0271d6767d8bf.tar.gz |
Fixed bug #32115 (dateTime encoding of timezone incorrect)
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r-- | ext/soap/php_encoding.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index ec27db3d90..af78405581 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2287,7 +2287,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma int max_reallocs = 5; size_t buf_len=64, real_len; char *buf; - char tzbuf[6]; + char tzbuf[8]; xmlNodePtr xmlParam; @@ -2309,19 +2309,19 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma /* Time zone support */ #ifdef HAVE_TM_GMTOFF - sprintf(tzbuf, "%c%02d%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 )); + sprintf(tzbuf, "%c%02d:%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 )); #else # ifdef __CYGWIN__ - sprintf(tzbuf, "%c%02d%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60)); + sprintf(tzbuf, "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60)); # else - sprintf(tzbuf, "%c%02d%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60)); + sprintf(tzbuf, "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60)); # endif #endif - if (strcmp(tzbuf,"+0000") == 0) { + if (strcmp(tzbuf,"+00:00") == 0) { strcpy(tzbuf,"Z"); real_len++; } else { - real_len += 5; + real_len += 6; } if (real_len >= buf_len) { buf = (char *) erealloc(buf, real_len+1); |