mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
Firewall/alias, fix is_alias() compatibility for https://github.com/opnsense/core/issues/1858
This commit is contained in:
parent
14652b4fb1
commit
87c7d90857
@ -53,8 +53,17 @@ function alias_make_table($config)
|
||||
global $aliastable;
|
||||
|
||||
$aliastable = array();
|
||||
|
||||
if (isset($config['aliases']['alias'])) {
|
||||
$aliasMdl = new \OPNsense\Firewall\Alias();
|
||||
// MVC defined aliases
|
||||
foreach ($aliasMdl->aliases->alias->__items as $alias) {
|
||||
if (strncmp((string)$alias->type, 'url', 3) !== 0) {
|
||||
$aliastable[(string)$alias->name] = implode(" ", explode("\n", $alias->content));
|
||||
} else {
|
||||
$aliastable[(string)$alias->name] = "";
|
||||
}
|
||||
}
|
||||
// legacy defined, keep during transition.
|
||||
if (empty($aliastable) && isset($config['aliases']['alias'])) {
|
||||
foreach ($config['aliases']['alias'] as $alias) {
|
||||
if ($alias['name']) {
|
||||
$aliastable[$alias['name']] = isset($alias['address']) ? $alias['address'] : null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user