mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
Routes/mvc, missing isset() in validations, closes https://github.com/opnsense/core/issues/3024
This commit is contained in:
parent
0dbc3cc51e
commit
15876d6163
@ -56,7 +56,8 @@ class Route extends BaseModel
|
||||
$proto_net = strpos($route->network, ':') === false ? "inet" : "inet6";
|
||||
// Gateway addresses are stored in the result list received from configd.
|
||||
// Unfortunately we can't trust the config here, so we use the list results here.
|
||||
$gateway = $route->gateway->getNodeData()[(string)$route->gateway];
|
||||
$gateways = $route->gateway->getNodeData();
|
||||
$gateway = isset($gateways[(string)$route->gateway]) ? $gateways[(string)$route->gateway] : null;
|
||||
$tmp = explode("-", $gateway['value']);
|
||||
$gateway_ip = !empty($tmp) ? end($tmp) : "";
|
||||
$gateway_proto = strpos($gateway_ip, ":") !== false ? "inet6" : "inet";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user