Commit 86eeda7f authored by anarcat's avatar anarcat Committed by anarcat

fix zone guessing in case we hit a TLD (e.g. foo.com)

we don't allow manipulation of TLD zonefiles for now, for obvious
security reasons
parent 37eb51ec
......@@ -131,7 +131,7 @@ class provisionService_dns extends provisionService {
$subdomain = array();
$found = FALSE;
drush_log("zone $tld, found: $found, parts: " . count($parts));
while (!$found && (count($parts) >= 2)) {
while (!$found && (count($parts) > 2)) {
$tld = join(".", $parts);
if ($this->zone_exists($tld)) {
$found = TRUE;
......@@ -142,6 +142,8 @@ class provisionService_dns extends provisionService {
$found = FALSE;
}
}
// this is necessary if we hit the limit of two subdomains
$tld = join(".", $parts);
$subdomain = join(".", $subdomain);
if (!$subdomain) {
$subdomain = '@';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment