From d9e258bb1df4c8a0d720c818ad433f8e9f6c3824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Wed, 23 Dec 2009 21:19:34 +0000 Subject: [PATCH] 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. --- etc/inc/util.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 92bb23fc5a..6727f94bee 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -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