fix unset params

This commit is contained in:
Jean-Christian Paul Denis 2023-05-11 23:53:03 +02:00
parent f5cf859982
commit 043045f373
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -166,7 +166,7 @@ class ActivityReport
$params['blog_id'] = [$params['blog_id']];
}
$sql->and('E.blog_id' . $sql->in($params['blog_id']));
} elseif (is_null($params['blog_id'])) {
} elseif (isset($params['blog_id']) && is_null($params['blog_id'])) {
$sql->and('E.blog_id IS NOT NULL');
} else {
$sql->and('E.blog_id = ' . $sql->quote((string) dcCore::app()->blog?->id));
@ -208,7 +208,7 @@ class ActivityReport
$or[] = $sql->andGroup(['activity_group = ' . $sql->quote($group), 'activity_action = ' . $sql->quote($action)]);
}
}
if (empty($or)) {
if (!empty($or)) {
$sql->and($sql->orGroup($or));
}
}