diff options
author | jim-p <jimp@pfsense.org> | 2013-11-12 16:24:06 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-11-12 16:24:06 -0500 |
commit | dc36992067d3aa78702c493b47baa2c58f98f7fd (patch) | |
tree | 307d4cc23ff4cbb3b02915e5f5d74552585230be | |
parent | 333d9e83cf67dbbf46b4f8cbdf67f557b8be98a8 (diff) | |
download | pfsense-packages-dc36992067d3aa78702c493b47baa2c58f98f7fd.tar.gz pfsense-packages-dc36992067d3aa78702c493b47baa2c58f98f7fd.tar.bz2 pfsense-packages-dc36992067d3aa78702c493b47baa2c58f98f7fd.zip |
Fix input validation so it does not incorrectly state that a valid config ending in a ; is invalid.
-rw-r--r-- | config/squid/squid.inc | 13 |
1 files changed, 7 insertions, 6 deletions
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) { |