mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
Firewall/alias, disabled alias should leave us with an empty one, for https://github.com/opnsense/core/issues/2860
This commit is contained in:
parent
9ee4921d42
commit
1d9b7ef480
@ -70,6 +70,8 @@ class Alias(object):
|
||||
tmp = subelem.text.strip()
|
||||
if len(tmp.split('.')) <= 2 and tmp.replace('.', '').isdigit():
|
||||
self._ttl = int(float(tmp))
|
||||
elif subelem.tag in ('aliasurl', 'address', 'url') and subelem.text is None:
|
||||
self._items = set()
|
||||
elif subelem.tag == 'aliasurl':
|
||||
self._items = set(sorted(subelem.text.split()))
|
||||
elif subelem.tag == 'address' and len(self._items) == 0:
|
||||
|
||||
@ -13,7 +13,9 @@
|
||||
<name>{{ alias.name|e }}</name>
|
||||
<descr>{{ alias.description|default('')|e}}</descr>
|
||||
<type>{{ alias.type }}</type>
|
||||
{% if alias.type.startswith('urltable') %}
|
||||
{% if alias.enabled|default('0') == '0'%}
|
||||
<address></address>
|
||||
{% elif alias.type.startswith('urltable') %}
|
||||
<url>{{ alias.content|e }}</url>
|
||||
{% elif alias.type.startswith('url') %}
|
||||
<aliasurl>{{ alias.content|e }}</aliasurl>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user