diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php b/framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php index 9a7e893ec00..93b38c17dd0 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php @@ -967,9 +967,7 @@ public function isDuplicatePIMAddition($id) * @param string $devid The device id. * @param string $user The user id. * @param array $fields An array of fields to return. Default is to return - * the full cache. Unused in the SQL driver, all - * fields are always returned since the data is stored - * serialized in the backend. @since 2.9.0 + * the full cache. @since 2.9.0 * * @return array The current sync cache for the user/device combination. * @throws Horde_ActiveSync_Exception @@ -985,7 +983,7 @@ public function getSyncCache($devid, $user, array $fields = null) throw new Horde_ActiveSync_Exception($e); } if (!$data = unserialize($data)) { - return array( + $data = array( 'confirmed_synckeys' => array(), 'lasthbsyncstarted' => false, 'lastsyncendnormal' => false, @@ -997,9 +995,12 @@ public function getSyncCache($devid, $user, array $fields = null) 'collections' => array(), 'pingheartbeat' => false, 'synckeycounter' => array()); - } else { - return $data; } + if (!is_null($fields)) { + $data = array_intersect_key($data, array_flip($fields)); + } + + return $data; } /**