From 00ce9a3181c9b4625fbfa85337afd2156e5d0393 Mon Sep 17 00:00:00 2001 From: Carsten Wolff Date: Tue, 3 Aug 2004 16:09:27 +0000 Subject: [PATCH] vbXMLRPC needs a slightly different dateformat. --- phpgwapi/inc/class.xmlrpc_server.inc.php | 12 +++++++++++- phpgwapi/inc/class.xmlrpc_server_php.inc.php | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.xmlrpc_server.inc.php b/phpgwapi/inc/class.xmlrpc_server.inc.php index ffc3c8ccda..bcd665a828 100644 --- a/phpgwapi/inc/class.xmlrpc_server.inc.php +++ b/phpgwapi/inc/class.xmlrpc_server.inc.php @@ -27,9 +27,19 @@ { if (!is_array($date)) { + if(strstr($_SERVER['HTTP_USER_AGENT'],"vbXMLRPC")) + { + return date('Ymd\TH:i:s',$date); + } return date('Y-m-d\TH:i:s',$date); } - return sprintf('%04d-%02d-%02dT%02d:%02d:%02d', + + $formatstring = "%04d-%02d-%02dT%02d:%02d:%02d"; + if(strstr($_SERVER['HTTP_USER_AGENT'],"vbXMLRPC")) + { + $formatstring = "%04d%02d%02dT%02d:%02d:%02d"; + } + return sprintf($formatstring, $date['year'],$date['month'],$date['mday'], $date['hour'],$date['min'],$date['sec']); } diff --git a/phpgwapi/inc/class.xmlrpc_server_php.inc.php b/phpgwapi/inc/class.xmlrpc_server_php.inc.php index 839b4c349c..a91d600c3f 100644 --- a/phpgwapi/inc/class.xmlrpc_server_php.inc.php +++ b/phpgwapi/inc/class.xmlrpc_server_php.inc.php @@ -237,7 +237,8 @@ } $_type = (is_integer($_res) ? 'int' : gettype($_res)); - if ($_type == 'string' && ereg('^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res)) + if ($_type == 'string' && (ereg('^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res) + || ereg('^[0-9]{4}[0-9]{2}[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res) ) ) { $_type = 'dateTime.iso8601'; }