Bug #12124
closedCreating or editing aliases fails with multiple hosts separated by spaces
100%
Description
Normally you can input multiple host/network aliases on the first form input if you separate each with an space.
This work ok in pfsense 2.4.1, but in 2.5.2 (also in 2.5.1) if you input a rather large (say 280+ chars string) amount of IPs/host/networks separed by an space in the same form input, the process fails with an error.
I've tracked the issue to the idn_to_ascii php function returning an invalid value with a large string input.
The following patch resolve the issue by disabling idn to ascii convertion:
--- /usr/local/pfSense/include/www/alias-utils.inc
+++ /usr/local/pfSense/include/www/alias-utils.inc@ -344,7 +344,7
@
$detail_text = sprintf(gettext("Entry added %s"), date('r'));
}
- $address_items = explode(" ", trim(alias_idn_to_ascii($post["address{$x}"])));
+ $address_items = explode(" ", trim($post["address{$x}"]));
foreach ($address_items as $address_item) {
$iprange_type = is_iprange($address_item);
if ($iprange_type == 4) {
I think the problem is trying to pass idn_to_ascii the whole string, maybe passing the individual exploded strings one by one to idn_to_ascii does not trigger the issue.