I think that check in general is probably dated... I'd remove the check entirely.
Find this code:
if (strlen($domArr[count($domArr)-1]) !=2 && !preg_match($knownDomsPat,$domArr[count($domArr)-1])) {
$isValid = false;
}
and then delete those lines.