Enhance Proxmox components with input validation, error handling, and UI improvements
This commit is contained in:
@@ -946,6 +946,12 @@ class Firewall extends Component
|
||||
}
|
||||
|
||||
if ($this->editingAliasName) {
|
||||
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_\-]*$/', $this->editingAliasName)) {
|
||||
$this->error = 'Invalid alias name format';
|
||||
$this->showErrorModal = true;
|
||||
$this->loading = false;
|
||||
return;
|
||||
}
|
||||
$response = $this->firewallRequest(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/firewall/aliases/' . $this->editingAliasName,
|
||||
'put',
|
||||
@@ -1243,6 +1249,12 @@ class Firewall extends Component
|
||||
$payload['nomatch'] = 1;
|
||||
}
|
||||
|
||||
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_\-]*$/', $this->selectedIPSetName ?? '')) {
|
||||
$this->error = 'Invalid IPSet name format';
|
||||
$this->showErrorModal = true;
|
||||
$this->loading = false;
|
||||
return;
|
||||
}
|
||||
$response = $this->firewallRequest(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/firewall/ipset/' . $this->selectedIPSetName,
|
||||
'post',
|
||||
@@ -1283,6 +1295,12 @@ class Firewall extends Component
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_\-]*$/', $this->selectedIPSetName)) {
|
||||
$this->error = 'Invalid IPSet name format';
|
||||
$this->showErrorModal = true;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->loading = true;
|
||||
$this->showDeleteIPSetMemberModal = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user