We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 6ff31490 authored by Evan Prodromou's avatar Evan Prodromou

SearchSub respects empty set from memcache.

parent d4b7f5d8
......@@ -147,18 +147,18 @@ class SearchSub extends Managed_DataObject
$keypart = sprintf('searchsub:by_profile:%d', $profile->id);
$searchstring = self::cacheGet($keypart);
if ($searchstring !== false && !empty($searchstring)) {
$searches = explode(',', $searchstring);
if ($searchstring !== false) {
if (!empty($searchstring)) {
$searches = explode(',', $searchstring);
}
} else {
$searchsub = new SearchSub();
$searchsub->profile_id = $profile->id;
$searchsub->selectAdd();
$searchsub->selectAdd('search');
if ($searchsub->find()) {
while ($searchsub->fetch()) {
if (!empty($searchsub->search)) {
$searches[] = $searchsub->search;
}
}
$searches = $searchsub->fetchAll('search');
}
self::cacheSet($keypart, implode(',', $searches));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment