Skip to content

Commit 40f17dc

Browse files
fix: use get_pf_reserved() to identify reserved names instead of globals
1 parent 2675cd1 commit 40f17dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/FilterNameValidator.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class FilterNameValidator extends Validator {
2222
* @throws ValidationError When the value is not a valid firewall filter name.
2323
*/
2424
public function validate(mixed $value, string $field_name = ''): void {
25-
global $pf_reserved_keywords, $reserved_table_names;
25+
$reserved_names = get_pf_reserved();
2626

2727
# Throw an exception if this name is reserved
28-
if (in_array($value, array_merge($pf_reserved_keywords, $reserved_table_names))) {
28+
if (in_array($value, $reserved_names)) {
2929
throw new ValidationError(
3030
message: "Field '$field_name' cannot be '$value' because it is a name reserved by the system.",
3131
response_id: 'FILTER_NAME_VALIDATOR_RESERVED_NAME_USED',

0 commit comments

Comments
 (0)