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.
Updated by Christian McDonald over 3 years ago
- Status changed from New to Pull Request Review
- Assignee set to Christian McDonald
Updated by Renato Botelho over 3 years ago
- Status changed from Pull Request Review to Feedback
- Target version set to 2.6.0
- Plus Target Version set to 21.09
PR has been merged. Thanks!
Updated by Christian McDonald over 3 years ago
- % Done changed from 0 to 100
Applied in changeset 0dfe04026ae5245fb075b5f44be4913a239b14a9.
Updated by Danilo Zrenjanin over 3 years ago
- Status changed from Feedback to Resolved
Tested on the:
2.6.0-DEVELOPMENT (amd64) built on Thu Jul 15 09:42:13 EDT 2021 FreeBSD 12.2-STABLE
It works fine now. Ticket resolved.
Updated by Jim Pingle about 3 years ago
- Subject changed from Creating or editing aliases fails when inputting multiple hosts separated by spaces to Creating or editing aliases fails with multiple hosts separated by spaces
Updating subject for release notes.
Updated by Jim Pingle about 3 years ago
- Plus Target Version changed from 21.09 to 22.01