From 0a4911566cfe934a77c0ccb757e59448879bb06a Mon Sep 17 00:00:00 2001 From: onli Date: Mon, 15 Mar 2021 23:24:03 +0100 Subject: [PATCH] php8 compat: Prevent unused key error --- include/functions_config.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index e9d1dcf3..e53e733d 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -1941,6 +1941,10 @@ function serendipity_ACL_SQL(&$cond, $append_category = false, $type = 'category break; } + if (! array_key_exists('joins', $cond) ) { + $cond['joins'] = ''; + } + $cond['joins'] .= " LEFT JOIN {$serendipity['dbPrefix']}authorgroups AS acl_a ON acl_a.authorid = " . $read_id . " LEFT JOIN {$serendipity['dbPrefix']}access AS acl_acc @@ -1950,7 +1954,7 @@ function serendipity_ACL_SQL(&$cond, $append_category = false, $type = 'category )"; if (empty($cond['and'])) { - $cond['and'] .= ' WHERE '; + $cond['and'] = ' WHERE '; } else { $cond['and'] .= ' AND '; }