if ($use_groups) {
$mygroups = serendipity_checkPermission(null, null, true);
$groupcond = array();
- foreach($mygroups AS $mygroup) {
+ foreach((array)$mygroups AS $mygroup) {
$groupcond[] .= "ep_access_groups.value LIKE '%;$mygroup;%'";
}
- $conds[] = " (ep_access_groups.property IS NULL OR ep_access.value = 'member' AND (" . implode(' OR ', $groupcond) . "))";
+ if (count($groupcond) > 1) {
+ $conds[] = " (ep_access_groups.property IS NULL OR ep_access.value = 'member' AND (" . implode(' OR ', $groupcond) . "))";
+ }
}
} else {
$conds[] = " (ep_access.property IS NULL OR ep_access.value = 'public') ";
}
/* vim: set sts=4 ts=4 expandtab : */
-?>
+?>
\ No newline at end of file