Skip to content

Commit c5b5f10

Browse files
committed
refactor: improved code
1 parent 7dfaa0e commit c5b5f10

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

phpmyfaq/admin/record.edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221

222222
// Group permissions
223223
$groupPermission = $faqPermission->get(FaqPermission::GROUP, $faqData['id']);
224-
if (count($groupPermission) == 0 || $groupPermission[0] == -1) {
224+
if (empty($groupPermission) || in_array(-1, $groupPermission, true)) {
225225
$allGroups = true;
226226
$restrictedGroups = false;
227227
$groupPermission[0] = -1;

phpmyfaq/src/phpMyFAQ/Faq/FaqPermission.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ public function delete(string $mode, int $faqId): bool
8787
$mode,
8888
$faqId
8989
);
90-
$this->config->getDb()->query($query);
9190

92-
return true;
91+
return (bool) $this->config->getDb()->query($query);
9392
}
9493

9594
/**

0 commit comments

Comments
 (0)