diff --git a/phpmyfaq/admin/record.edit.php b/phpmyfaq/admin/record.edit.php index f41663b680..bea02d5be6 100644 --- a/phpmyfaq/admin/record.edit.php +++ b/phpmyfaq/admin/record.edit.php @@ -221,7 +221,7 @@ // Group permissions $groupPermission = $faqPermission->get(FaqPermission::GROUP, $faqData['id']); - if (count($groupPermission) == 0 || $groupPermission[0] == -1) { + if (empty($groupPermission) || in_array(-1, $groupPermission, true)) { $allGroups = true; $restrictedGroups = false; $groupPermission[0] = -1; diff --git a/phpmyfaq/src/phpMyFAQ/Faq/FaqPermission.php b/phpmyfaq/src/phpMyFAQ/Faq/FaqPermission.php index 4975128e5a..da42a5bc76 100644 --- a/phpmyfaq/src/phpMyFAQ/Faq/FaqPermission.php +++ b/phpmyfaq/src/phpMyFAQ/Faq/FaqPermission.php @@ -87,9 +87,8 @@ public function delete(string $mode, int $faqId): bool $mode, $faqId ); - $this->config->getDb()->query($query); - return true; + return (bool) $this->config->getDb()->query($query); } /**