From f3dad94b38d3fee09b47e35764a87e522bb5de8c Mon Sep 17 00:00:00 2001 From: Alexander Shursha Date: Wed, 16 Jan 2019 11:53:55 +0300 Subject: [PATCH] Add support IDN in aliases. (#3107) --- src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php | 2 +- .../service/templates/OPNsense/Filter/filter_tables.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php b/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php index b469fb7e6..db8726c69 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php +++ b/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php @@ -214,7 +214,7 @@ class Util */ public static function isDomain($domain) { - $pattern = '/^(?:(?:[a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*(?:[a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$/i'; + $pattern = '/^(?:(?:[a-z\pL0-9]|[a-z\pL0-9][a-z\pL0-9\-]*[a-z\pL0-9])\.)*(?:[a-z\pL0-9]|[a-z\pL0-9][a-z\pL0-9\-]*[a-z\pL0-9])$/iu'; if (preg_match($pattern, $domain)) { return true; } diff --git a/src/opnsense/service/templates/OPNsense/Filter/filter_tables.conf b/src/opnsense/service/templates/OPNsense/Filter/filter_tables.conf index 917ce4146..013ab567e 100644 --- a/src/opnsense/service/templates/OPNsense/Filter/filter_tables.conf +++ b/src/opnsense/service/templates/OPNsense/Filter/filter_tables.conf @@ -16,11 +16,11 @@ {% if alias.enabled|default('0') == '0'%}
{% elif alias.type.startswith('urltable') %} - {{ alias.content|e }} + {{ alias.content|e|encode_idna }} {% elif alias.type.startswith('url') %} - {{ alias.content|e }} + {{ alias.content|e|encode_idna }} {% elif alias.content %} -
{{ alias.content|e }}
+
{{ alias.content|e|encode_idna }}
{% endif %}{% if alias.proto %} {{ alias.proto|e }} {% endif %}{% if alias.updatefreq %}