fixed hostheader import: subdomain pointer gets assigned to parent instead of

subdomain
This commit is contained in:
robvde 2012-10-29 20:55:52 +04:00
parent 1d3c5a8a29
commit dbab36dbd9

View file

@ -3760,19 +3760,21 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
private static int FindDomainForHeader(string header, List<DomainInfo> domains) private static int FindDomainForHeader(string header, List<DomainInfo> domains)
{ {
int domainId = 0; int domainId = 0;
int counter = 0;
while (header.IndexOf(".") != -1) while ((header.IndexOf(".") != -1) & (counter < 2))
{ {
header = header.Substring(header.IndexOf(".") + 1);
foreach (DomainInfo d in domains) foreach (DomainInfo d in domains)
{ {
if ((header == d.DomainName.ToLower()) && (!d.IsDomainPointer)) if ((header == d.DomainName.ToLower()) && (!d.IsDomainPointer))
{ {
domainId = d.DomainId; return d.DomainId;
break;
} }
} }
header = header.Substring(header.IndexOf(".") + 1);
counter++;
} }
return domainId; return domainId;