From dc36992067d3aa78702c493b47baa2c58f98f7fd Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 12 Nov 2013 16:24:06 -0500 Subject: Fix input validation so it does not incorrectly state that a valid config ending in a ; is invalid. --- config/squid/squid.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'config/squid') diff --git a/config/squid/squid.inc b/config/squid/squid.inc index 34186407..e136d9f8 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -447,12 +447,13 @@ function squid_validate_nac($post, $input_errors) { $input_errors[] = "The time range '$time' is not a valid time range"; } - if(!empty($post['ext_cachemanager'])) { - $extmgr = explode(";", ($post['ext_cachemanager'])); - foreach ($extmgr as $mgr) { - if (!is_ipaddr($mgr)) - $input_errors[] = 'You must enter a valid IP address in the \'External Cache Manager\' field'; - }} + if(!empty($post['ext_cachemanager'])) { + $extmgr = explode(";", ($post['ext_cachemanager'])); + foreach ($extmgr as $mgr) { + if (!empty($mgr) && !is_ipaddr($mgr)) + $input_errors[] = 'You must enter a valid IP address in the \'External Cache Manager\' field'; + } + } } function squid_validate_traffic($post, $input_errors) { -- cgit v1.2.3