Skip to content

Commit

Permalink
Merge pull request #93 from binsky08/issue-92-hotfix
Browse files Browse the repository at this point in the history
hotfix for idn_to_ascii() using php7.4-intl
  • Loading branch information
jethrocarr authored Oct 7, 2020
2 parents 41816c8 + 58cca54 commit a4c1377
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions bind/include/application/inc_bind.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ function action_generate_zonefile( $domain_name, $domain_id )
if (function_exists("idn_to_ascii"))
{
$record["record_name"] = idn_to_ascii($record["record_name"]);
$record["record_content"] = idn_to_ascii($record["record_content"]);
$record["record_content"] = idn_to_ascii($record["record_content"], IDNA_DEFAULT, INTL_IDNA_VARIANT_2003);
}

// handle origin and content format
Expand Down Expand Up @@ -537,7 +537,7 @@ function action_generate_zonefile( $domain_name, $domain_id )
if (function_exists("idn_to_ascii"))
{
$record["record_name"] = idn_to_ascii($record["record_name"]);
$record["record_content"] = idn_to_ascii($record["record_content"]);
$record["record_content"] = idn_to_ascii($record["record_content"], IDNA_DEFAULT, INTL_IDNA_VARIANT_2003);
}

// handle origin and content format
Expand Down Expand Up @@ -570,7 +570,7 @@ function action_generate_zonefile( $domain_name, $domain_id )
if (function_exists("idn_to_ascii"))
{
$record["record_name"] = idn_to_ascii($record["record_name"]);
$record["record_content"] = idn_to_ascii($record["record_content"]);
$record["record_content"] = idn_to_ascii($record["record_content"], IDNA_DEFAULT, INTL_IDNA_VARIANT_2003);
}

if (strpos($record["record_name"], "ip6.arpa"))
Expand All @@ -597,7 +597,7 @@ function action_generate_zonefile( $domain_name, $domain_id )
if (function_exists("idn_to_ascii"))
{
$record["record_name"] = idn_to_ascii($record["record_name"]);
$record["record_content"] = idn_to_ascii($record["record_content"]);
$record["record_content"] = idn_to_ascii($record["record_content"], IDNA_DEFAULT, INTL_IDNA_VARIANT_2003);
}

if (preg_match("/\./", $record["record_name"]) && preg_match("/". $domain_name ."$/", $record["record_name"]))
Expand Down Expand Up @@ -638,7 +638,7 @@ function action_generate_zonefile( $domain_name, $domain_id )

// idn_to_ascii has a lovely habit of blowing up with some record values, such as
// DKIM records. If idn_to_ascii fails, we leave the value unchanged
if ($tmp = idn_to_ascii($record["record_content"]))
if ($tmp = idn_to_ascii($record["record_content"], IDNA_DEFAULT, INTL_IDNA_VARIANT_2003))
{
$record["record_content"] = $tmp;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/include/application/inc_domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function load_data_record_all($exclude_forwardrev = NULL)
if ($this->format == 'idn')
{
$data_records["name"] = idn_to_ascii($data_records["name"]);
$data_records["content"] = idn_to_ascii($data_records["content"]);
$data_records["content"] = idn_to_ascii($data_records["content"], IDNA_DEFAULT, INTL_IDNA_VARIANT_2003);
}

$this->data["records"][] = $data_records;
Expand Down

0 comments on commit a4c1377

Please sign in to comment.