From 6e592ed2005eef2a7ae6fa96d4e1afbbde85523d Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 25 Mar 2024 16:09:53 +0000 Subject: add the observer hash to the cache key in categories_widget() --- Zotlabs/Daemon/Cache_query.php | 5 ++++- include/contact_widgets.php | 7 +++++-- 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 @@ ','[',']'),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); -- cgit v1.2.3