diff options
author | Mario <mario@mariovavti.com> | 2024-03-25 16:09:53 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-25 17:18:26 +0000 |
commit | 6e592ed2005eef2a7ae6fa96d4e1afbbde85523d (patch) | |
tree | 6f088d92af02b06a4fdbbd6ab6bd74f6614083c6 | |
parent | 6c033fc7768a48d70fea1375b157e8474a98b570 (diff) | |
download | volse-hubzilla-6e592ed2005eef2a7ae6fa96d4e1afbbde85523d.tar.gz volse-hubzilla-6e592ed2005eef2a7ae6fa96d4e1afbbde85523d.tar.bz2 volse-hubzilla-6e592ed2005eef2a7ae6fa96d4e1afbbde85523d.zip |
add the observer hash to the cache key in categories_widget()
-rw-r--r-- | Zotlabs/Daemon/Cache_query.php | 5 | ||||
-rw-r--r-- | include/contact_widgets.php | 7 | ||||
-rw-r--r-- | include/taxonomy.php | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/Zotlabs/Daemon/Cache_query.php b/Zotlabs/Daemon/Cache_query.php index cd9597e9a..d6f66f1f0 100644 --- a/Zotlabs/Daemon/Cache_query.php +++ b/Zotlabs/Daemon/Cache_query.php @@ -11,6 +11,7 @@ class Cache_query { if(! $argc == 3) return; + $r = null; $key = $argv[1]; $pid = get_config('procid', $key, false); @@ -28,8 +29,10 @@ class Cache_query { $arr = json_decode(base64_decode($argv[0]), true); $r = call_user_func_array('q', $arr); - if($r) + + if(is_array($r)) { Cache::set($key, serialize($r)); + } del_config('procid', $key); diff --git a/include/contact_widgets.php b/include/contact_widgets.php index c05ecaf7c..8ad36e049 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -1,6 +1,7 @@ <?php /** @file */ use Zotlabs\Lib\Cache; +use Zotlabs\Daemon\Master; function findpeople_widget() { @@ -70,7 +71,9 @@ function categories_widget($baseurl,$selected = '') { $item_normal = item_normal(); - $key = __FUNCTION__ . "-" . App::$profile['profile_uid']; + $observer = get_observer_hash(); + + $key = __FUNCTION__ . '_' . md5(App::$profile['profile_uid'] . $observer); $content = Cache::get($key, '5 MINUTE'); if (! $content) { @@ -96,7 +99,7 @@ function categories_widget($baseurl,$selected = '') { dbesc(ACTIVITY_UPDATE) ]; - \Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]); + Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]); } if (!$content) { diff --git a/include/taxonomy.php b/include/taxonomy.php index 90ccb6142..dd56ab956 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -6,7 +6,7 @@ // To do this we need to escape these characters if they appear in our tag. use Zotlabs\Lib\Cache; - +use Zotlabs\Daemon\Master; function file_tag_encode($s) { return str_replace(array('<','>','[',']'),array('%3c','%3e','%5b','%5d'),$s); @@ -357,7 +357,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) { } } - $key = __FUNCTION__ . "-" . md5($site . $recent . $safemode . $limit . $type); + $key = __FUNCTION__ . '_' . md5($site . $recent . $safemode . $limit . $type); $content = Cache::get($key, '5 MINUTE'); if(! $content) { @@ -377,7 +377,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) { (intval($count) ? "LIMIT $count" : '') ]; - \Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]); + Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]); } $r = unserialize($content); |