refactor: replace allowed IPs validation logic with regex

This commit is contained in:
Cinzya 2025-10-22 20:55:24 +02:00
parent b0026b3be8
commit e160b5139a

View file

@ -89,7 +89,7 @@ public function submit()
$allowsFromAnywhere = false;
if (empty($this->allowed_ips)) {
$allowsFromAnywhere = true;
} elseif ($this->allowed_ips === '0.0.0.0' || str_contains($this->allowed_ips, '0.0.0.0')) {
} elseif ($this->allowed_ips === '0.0.0.0' || in_array('0.0.0.0', array_map('trim', explode(',', $this->allowed_ips)))) {
$allowsFromAnywhere = true;
}