simplified if return

Simplify if control structures that return the boolean result of their condition.
This commit is contained in:
MathiasReker 2022-06-16 19:33:09 +02:00
parent a4d87ad5bd
commit 0747b8ca05
1 changed files with 4 additions and 4 deletions

View File

@ -4105,12 +4105,12 @@ class PHPMailer
//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) {
return (bool) (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false)
//Is it a syntactically valid hostname?
return true;
}
return false;
;
}
/**