Skip to content

Commit

Permalink
fix: corrected handling of restricted groups, closes #2953
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed May 16, 2024
1 parent 9e73893 commit 1026374
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion phpmyfaq/assets/templates/admin/content/faq.editor.twig
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
<label class="form-check-label" for="restrictedgroups">
{{ ad_entry_restricted_groups }}
</label>
<select id="restrictedgroups" name="restricted_groups[]" size="3" class="form-control" multiple>
<select id="restrictedgroups" name="restricted_groups" size="3" class="form-control" multiple>
{{ groupPermissionOptions | raw }}
</select>
</div>
Expand Down
8 changes: 5 additions & 3 deletions phpmyfaq/src/phpMyFAQ/Faq/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ public function createPermissionArray(): array
'restricted_groups' => [-1],
];
} else {
$permissions += Filter::filterArray(
$data->restricted_groups
);
$permissions += [
'restricted_groups' => [
Filter::filterArray($data->{'restricted_groups'}, FILTER_VALIDATE_INT),
]
];
}

return $permissions;
Expand Down

0 comments on commit 1026374

Please sign in to comment.