Skip to content

Commit

Permalink
fixed strict check
Browse files Browse the repository at this point in the history
  • Loading branch information
craue committed Nov 5, 2014
1 parent 0536776 commit 2ec7bab
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Egulias/EmailValidator/EmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function isValid($email, $checkDNS = false, $strict = false)
return false;
}

$dns = false;
$dns = true;
if ($checkDNS) {
$dns = $this->checkDNS();
}
Expand All @@ -95,12 +95,7 @@ public function isValid($email, $checkDNS = false, $strict = false)
return false;
}

return ($strict) ? $this->checkStrict($dns) : true;
}

private function checkStrict($dns)
{
return !($this->hasWarnings() && !$dns);
return !$strict || (!$this->hasWarnings() && $dns);
}

/**
Expand Down

0 comments on commit 2ec7bab

Please sign in to comment.