From 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 24 Mar 2024 09:58:21 +0000 Subject: Deprecate *_config() functions in core. --- include/contact_widgets.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/contact_widgets.php') diff --git a/include/contact_widgets.php b/include/contact_widgets.php index c05ecaf7c..43aae4b25 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -1,10 +1,11 @@ ' -- cgit v1.2.3 From 842df8a7991688ccb0770dcca0119acf728e1c8b 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() --- include/contact_widgets.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/contact_widgets.php') diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 43aae4b25..3589653c1 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -2,6 +2,7 @@ use Zotlabs\Lib\Cache; use Zotlabs\Lib\Config; +use Zotlabs\Daemon\Master; function findpeople_widget() { @@ -71,7 +72,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) { @@ -97,7 +100,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) { -- cgit v1.2.3 From 9ecd38911e6094e2867d490e2da5f65ecedf0370 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 25 Mar 2024 17:31:53 +0000 Subject: add observer to the permissions query. this should not be necessary but it makes it clear why it should be included in the cache key (cherry picked from commit 57e32a79125072d27ebc76ca26acac64db5cb4fc) --- include/contact_widgets.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/contact_widgets.php') diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 3589653c1..84f688d36 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -68,12 +68,11 @@ function categories_widget($baseurl,$selected = '') { require_once('include/security.php'); - $sql_extra = item_permissions_sql(App::$profile['profile_uid']); + $observer = get_observer_hash(); + $sql_extra = item_permissions_sql(App::$profile['profile_uid'], $observer); $item_normal = item_normal(); - $observer = get_observer_hash(); - $key = __FUNCTION__ . '_' . md5(App::$profile['profile_uid'] . $observer); $content = Cache::get($key, '5 MINUTE'); -- cgit v1.2.3