Skip to content

Commit

Permalink
Merge pull request PHPMailer#2707 from MathiasReker/0-simplified-if-r…
Browse files Browse the repository at this point in the history
…eturn

simplified if return
  • Loading branch information
Synchro committed Jun 16, 2022
2 parents 70fde2a + 77d4559 commit 2f4b684
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/PHPMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4106,12 +4106,8 @@ public static function isValidHost($host)
//Is it a valid IPv4 address?
return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
}
if (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false) {
//Is it a syntactically valid hostname?
return true;
}

return false;
//Is it a syntactically valid hostname (when embeded in a URL)?
return filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false;
}

/**
Expand Down

0 comments on commit 2f4b684

Please sign in to comment.