If the port passed as argument is a range(having - in it) this function would still return true as a bad habit of intval. Fix this so it behaves correctly.

This commit is contained in:
Ermal Lui 2009-12-23 21:19:34 +00:00
parent a3e027f609
commit d9e258bb1d

View File

@ -302,6 +302,8 @@ function is_validaliasname($name) {
function is_port($port) {
if (getservbyname($port, "tcp") || getservbyname($port, "udp"))
return true;
if (!ctype_digit($port))
return false;
if ((intval($port) < 1) || (intval($port) > 65535))
return false;
else