Skip to content
Snippets Groups Projects
Commit cef531ed authored by anarcat's avatar anarcat Committed by anarcat
Browse files

remove more dead code

parent 4c2fed11
No related branches found
No related tags found
No related merge requests found
<?php
/**
* copy of frontend's hosting_dns_split_url
*/
function _dns_split_url($url) {
$tlds = split("\n", variable_get('hosting_dns_tlds', ''));
$first_dot = strpos($url, '.');
# Strip off the first part
$host = substr($url, 0, $first_dot);
$zone = substr($url, $first_dot);
# If the remaining hostname is a TLD
if (in_array($zone, $tlds)) {
# Add the first part back, and that's the zone (the host is @)
$zone = $host . $zone;
$host = '@';
} else {
# that's the zone (and the host is the first part)
$zone = substr($zone, 1); # strip the leading .
}
return array('host' => $host, 'zone' => $zone);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment