refactor: replace allowed IPs validation logic with regex
This commit is contained in:
parent
b0026b3be8
commit
e160b5139a
1 changed files with 1 additions and 1 deletions
|
|
@ -89,7 +89,7 @@ public function submit()
|
||||||
$allowsFromAnywhere = false;
|
$allowsFromAnywhere = false;
|
||||||
if (empty($this->allowed_ips)) {
|
if (empty($this->allowed_ips)) {
|
||||||
$allowsFromAnywhere = true;
|
$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;
|
$allowsFromAnywhere = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue