mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-09 23:18:59 +02:00
Cast to int
This commit is contained in:
parent
375a64a38e
commit
a97341f6f2
@ -23,7 +23,8 @@ class Endpoint
|
|||||||
$this->port = (int) $port;
|
$this->port = (int) $port;
|
||||||
|
|
||||||
if (str_contains($port, ':')) {
|
if (str_contains($port, ':')) {
|
||||||
[$this->ip, $this->port] = explode(':', $port);
|
[$this->ip, $port] = explode(':', $port);
|
||||||
|
$this->port = (int) $port;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw_unless(filter_var($this->ip, FILTER_VALIDATE_IP) !== false, new InvalidArgumentException("$this->ip is an invalid IP address"));
|
throw_unless(filter_var($this->ip, FILTER_VALIDATE_IP) !== false, new InvalidArgumentException("$this->ip is an invalid IP address"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user