Skip to content

Commit

Permalink
No reason not to restrict what is returned, even if we already have it.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Oct 16, 2013
1 parent 1be10f8 commit 8cded7f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 8cded7f

Please sign in to comment.