Branch 'roundcubemail-plugins-kolab-3.1' - plugins/libkolab

Thomas Brüderli bruederli at kolabsys.com
Tue Oct 22 09:55:41 CEST 2013


 plugins/libkolab/lib/kolab_format.php |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 7d39e6bdff1251f0e346fd2aef36f46ceb3356de
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Tue Oct 22 09:51:28 2013 +0200

    Fix saving created/changed dates: always use UTC timezone

diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php
index 5bcc57a..aa88f69 100644
--- a/plugins/libkolab/lib/kolab_format.php
+++ b/plugins/libkolab/lib/kolab_format.php
@@ -401,13 +401,13 @@ abstract class kolab_format
         // set some automatic values if missing
         if (empty($object['created']) && method_exists($this->obj, 'setCreated')) {
             $cdt = $this->obj->created();
-            $object['created'] = $cdt && $cdt->isValid() ? self::php_datetime($cdt) : new DateTime('now', self::$timezone);
+            $object['created'] = $cdt && $cdt->isValid() ? self::php_datetime($cdt) : new DateTime('now', new DateTimeZone('UTC'));
             if (!$cdt || !$cdt->isValid())
                 $this->obj->setCreated(self::get_datetime($object['created']));
         }
 
-        $object['changed'] = new DateTime('now', self::$timezone);
-        $this->obj->setLastModified(self::get_datetime($object['changed'], new DateTimeZone('UTC')));
+        $object['changed'] = new DateTime('now', new DateTimeZone('UTC'));
+        $this->obj->setLastModified(self::get_datetime($object['changed']));
 
         // Save custom properties of the given object
         if (isset($object['x-custom'])) {




More information about the commits mailing list