php8 compat: Prevent unused key error

This commit is contained in:
onli 2021-03-15 23:24:03 +01:00
parent 0c84f10b7c
commit 0a4911566c

View File

@ -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 ';
}