Skip to content

Commit

Permalink
Minor tweak to rdns display for obscure rdns records. #41
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneMcC committed Oct 27, 2021
1 parent b87115c commit f429fe2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ function getFullARPAIP($domain) {
} else if (preg_match('/.*\.in-addr\.arpa$/', $domain)) {
$mainptr = substr($domain, 0, strlen($domain) - 13);
$pieces = array_reverse(explode('.', $mainptr));
$dom = implode('.', $pieces);
$repeat = 4 - count($pieces);
$dom = implode('.', array_slice($pieces, 0, 3));
$repeat = 3 - count($pieces);
if ($repeat < 0) { $repeat = 0; }
$rdns = $dom . str_repeat('.0', $repeat);
$rdns = $dom . str_repeat('.0', $repeat) . '.' . $pieces[count($pieces) - 1];

return $rdns;
}
Expand Down

0 comments on commit f429fe2

Please sign in to comment.