From 043045f373fcd17cafd57e577f548ff9179dc125 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 11 May 2023 23:53:03 +0200 Subject: [PATCH] fix unset params --- src/ActivityReport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ActivityReport.php b/src/ActivityReport.php index 47922c8..057d348 100644 --- a/src/ActivityReport.php +++ b/src/ActivityReport.php @@ -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)); } }