From: Michael J. Rubinsky Date: Sun, 25 Apr 2010 20:41:31 +0000 (-0400) Subject: Only save the stat structure, and make sure it has a mod time entry. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fc1e820200efb6807df0562b8463142156ce5eda;p=horde.git Only save the stat structure, and make sure it has a mod time entry. --- diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php b/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php index 81a4968d9..3ee59074b 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/State/History.php @@ -252,7 +252,7 @@ class Horde_ActiveSync_State_History extends Horde_ActiveSync_State_Base * send all of them. */ $this->_logger->debug('Updating state during ' . $this->_type); - foreach ($this->_changes as $key => $value) { + foreach ($this->_changes as $key => $value) { if ($value['id'] == $change['id']) { if ($this->_type == 'foldersync') { foreach ($this->_state as $fi => $state) { @@ -260,7 +260,13 @@ class Horde_ActiveSync_State_History extends Horde_ActiveSync_State_Base unset($this->_state[$fi]); } } - $this->_state[] = $value; + /* Only save what we need, and ensure we have a mod time */ + $stat = array( + 'id' => $value['id'], + 'mod' => (empty($value['mod']) ? time() : $value['mod']), + 'parent' => (empty($value['parent']) ? 0 : $value['parent']) + ); + $this->_state[] = $stat; $this->_state = array_values($this->_state); } unset($this->_changes[$key]);