diff options
author | Justin Wood <Callek@gmail.com> | 2010-03-04 20:28:32 +0100 |
---|---|---|
committer | Justin Wood <Callek@gmail.com> | 2010-03-04 20:28:32 +0100 |
commit | 9a9405da0b6b5baf8157206d34ba3895fb33b788 (patch) | |
tree | 32d3d3ce23bb242c7d68515bfd92e4a8eb140ebd /Bugzilla/WebService/Server/XMLRPC.pm | |
parent | b30aeba04609049378374441209f7e808931e198 (diff) | |
download | bugzilla-9a9405da0b6b5baf8157206d34ba3895fb33b788.tar.gz bugzilla-9a9405da0b6b5baf8157206d34ba3895fb33b788.tar.xz |
Bug 545299, XML-RPC WebService should take and return dates and times in UTC. Code part, r+=mkanat
Diffstat (limited to 'Bugzilla/WebService/Server/XMLRPC.pm')
-rw-r--r-- | Bugzilla/WebService/Server/XMLRPC.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index f06c81fc7..04e38c4a0 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -106,10 +106,12 @@ sub decode_value { # We convert dateTimes to a DB-friendly date format. if ($type eq 'dateTime.iso8601') { - # We leave off the $ from the end of this regex to allow for possible - # extensions to the XML-RPC date standard. - $value =~ /^(\d{4})(\d{2})(\d{2})T(\d{2}):(\d{2}):(\d{2})/; - $value = "$1-$2-$3 $4:$5:$6"; + if ($value !~ /T.*[\-+Z]/i) { + # The caller did not specify a timezone, so we assume UTC. + # pass 'Z' specifier to datetime_from to force it + $value = $value . 'Z'; + } + $value = $self->datetime_format_inbound($value); } return $value; |