Skip to content
Snippets Groups Projects
Commit 42b425d0 authored by Marcus Comstedt's avatar Marcus Comstedt
Browse files

Allow FQDN (with trailing .) in zone_to_ascii.

Rev: lib/modules/Standards.pmod/IDNA.pmod:1.7
parent abf31d45
Branches
Tags
No related merge requests found
...@@ -432,6 +432,12 @@ string to_unicode(string s) ...@@ -432,6 +432,12 @@ string to_unicode(string s)
string zone_to_ascii(string s, int(0..1)|void allow_unassigned, string zone_to_ascii(string s, int(0..1)|void allow_unassigned,
int(0..1)|void use_std3_ascii_rules) int(0..1)|void use_std3_ascii_rules)
{ {
if(has_suffix(s, ".") && !has_suffix(s, ".."))
return sizeof(s)>1?
zone_to_ascii(s[..sizeof(s)-2], allow_unassigned,
use_std3_ascii_rules)+"."
: s;
else
return to_ascii((s/".")[*], allow_unassigned, use_std3_ascii_rules)*"."; return to_ascii((s/".")[*], allow_unassigned, use_std3_ascii_rules)*".";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment