Skip to content

Commit

Permalink
Convert punycode in zone list
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-pike committed Jan 26, 2020
1 parent 6929fd7 commit 7137c94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions templates/zones.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<tr data-name="<?php out(DNSZoneName::unqualify($zone->name))?>" data-serial="<?php out($zone->serial)?>" data-kind="<?php out($zone->kind)?>" data-account="<?php out($zone->account)?>" data-dnssec="<?php out($zone->dnssec)?>">
<td class="name">
<?php if($zone->pending_updates > 0) { ?><a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>#pending"><span class="badge"><?php out(number_format($zone->pending_updates))?></span></a><?php } ?>
<a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify($zone->name))?></a>
<a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify(punycode_to_utf8($zone->name)))?></a>
</td>
<td class="serial"><?php out($zone->serial)?></td>
<td class="kind"><?php out($zone->kind)?></td>
Expand Down Expand Up @@ -107,7 +107,7 @@
<tr data-name="<?php out(DNSZoneName::unqualify($zone->name))?>" data-ipv4-reverse-range="<?php out(ipv4_reverse_zone_to_range($zone->name))?>" data-ipv4-reverse-subnet="<?php out(ipv4_reverse_zone_to_subnet($zone->name))?>" data-serial="<?php out($zone->serial)?>" data-kind="<?php out($zone->kind)?>" data-account="<?php out($zone->account)?>" data-dnssec="<?php out($zone->dnssec)?>">
<td class="name">
<?php if($zone->pending_updates > 0) { ?><span class="badge"><?php out(number_format($zone->pending_updates))?></span><?php } ?>
<a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify($zone->name))?></a>
<a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify(punycode_to_utf8($zone->name)))?></a>
</td>
<td class="ipv4-reverse-range"><?php out(ipv4_reverse_zone_to_range($zone->name))?></td>
<td class="ipv4-reverse-subnet"><?php out(ipv4_reverse_zone_to_subnet($zone->name))?></td>
Expand Down Expand Up @@ -154,7 +154,7 @@
<tr data-name="<?php out(DNSZoneName::unqualify($zone->name))?>" data-ipv6-reverse-range="<?php out(ipv6_reverse_zone_to_range($zone->name))?>" data-ipv6-reverse-subnet="<?php out(ipv6_reverse_zone_to_subnet($zone->name))?>" data-serial="<?php out($zone->serial)?>" data-kind="<?php out($zone->kind)?>" data-account="<?php out($zone->account)?>" data-dnssec="<?php out($zone->dnssec)?>">
<td class="name">
<?php if($zone->pending_updates > 0) { ?><span class="badge"><?php out(number_format($zone->pending_updates))?></span><?php } ?>
<a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify($zone->name))?></a>
<a href="<?php outurl('/zones/'.urlencode(DNSZoneName::unqualify($zone->name)))?>"><?php out(DNSZoneName::unqualify(punycode_to_utf8($zone->name)))?></a>
</td>
<td class="ipv6-reverse-range"><tt><?php out(ipv6_reverse_zone_to_range($zone->name))?></tt></td>
<td class="ipv6-reverse-subnet"><?php out(ipv6_reverse_zone_to_subnet($zone->name))?></td>
Expand Down
4 changes: 2 additions & 2 deletions views/zones.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

$zones = $active_user->list_accessible_zones(array('pending_updates'));
usort($zones, function($a, $b) {
$aname = implode(',', array_reverse(explode('.', $a->name)));
$bname = implode(',', array_reverse(explode('.', $b->name)));
$aname = implode(',', array_reverse(explode('.', punycode_to_utf8($a->name))));
$bname = implode(',', array_reverse(explode('.', punycode_to_utf8($b->name))));
return strnatcasecmp($aname, $bname);
});

Expand Down

0 comments on commit 7137c94

Please sign in to comment.