Skip to content

Commit

Permalink
Fix cacheid for facebook search results
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Mar 31, 2014
1 parent 403fa4f commit 487c585
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions turba/lib/Driver/Facebook.php
Expand Up @@ -82,15 +82,15 @@ public function hasPermission($perm)
*/
protected function _search(array $criteria, array $fields, array $blobFields = array(), $count_only = false)
{
$key = implode('|', array(
$cid = implode('|', array(
'turba_fb_search',
$GLOBALS['registry']->getAuth(),
md5(json_encode($criteria) . '_' .
implode('.' , $fields) . '_' .
implode('.', $blobFields))
));

if ($values = $this->_cache->get($key, 3600)) {
if ($values = $this->_cache->get($cid, 3600)) {
$values = json_decode($values, true);
return $count_only ? count($values) : $values;
}
Expand All @@ -103,7 +103,7 @@ protected function _search(array $criteria, array $fields, array $blobFields = a
$results[$key] = $contact;
}
}
$this->_cache->set($key, json_encode($results));
$this->_cache->set($cid, json_encode($results));

return $count_only ? count($results) : $results;
}
Expand Down

0 comments on commit 487c585

Please sign in to comment.