From 5f63099c1a0ee48b71453ec256df6a993f5f7c6b Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Sun, 15 Apr 2012 13:29:52 +0000 Subject: squid3 - include some array checks to prevert erros on squid_reverse.inc --- config/squid-reverse/squid_reverse.inc | 13 +++++++++---- pkg_config.8.xml | 4 ++-- pkg_config.8.xml.amd64 | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/config/squid-reverse/squid_reverse.inc b/config/squid-reverse/squid_reverse.inc index c34f74e5..7c0025ba 100644 --- a/config/squid-reverse/squid_reverse.inc +++ b/config/squid-reverse/squid_reverse.inc @@ -100,7 +100,8 @@ function squid_resync_reverse() { $conf .= "cache_peer {$settings['reverse_owa_ip']} parent 443 0 proxy-only no-query originserver login=PASS connection-auth=on ssl sslflags=DONT_VERIFY_PEER front-end-https=on name=OWA_HOST_pfs\n"; $active_peers=array(); - foreach ($reverse_peers as $rp){ + if (is_array($reverse_peers)) + foreach ($reverse_peers as $rp){ if ($rp['enable'] =="on" && $rp['name'] !="" && $rp['ip'] !="" && $rp['port'] !=""){ $conf_peer = "#{$rp['description']}\n"; $conf_peer .= "cache_peer {$rp['ip']} parent {$rp['port']} 0 proxy-only no-query originserver login=PASS "; @@ -139,12 +140,15 @@ function squid_resync_reverse() { $conf .= "ignore_expect_100 on\n"; } } - foreach ($owa_dirs as $owa_dir) + if (is_array($owa_dirs)) + foreach ($owa_dirs as $owa_dir) $conf .= "acl OWA_URI_pfs url_regex -i ^https://{$settings['reverse_external_fqdn']}/$owa_dir.*$\n"; } //$conf .= "ssl_unclean_shutdown on"; - foreach ($reverse_maps as $rm){ - if ($rm['enable'] == "on" && $rm['name']!="" && $rm['peers']!="") + if (is_array($reverse_maps)) + foreach ($reverse_maps as $rm){ + if ($rm['enable'] == "on" && $rm['name']!="" && $rm['peers']!=""){ + if (is_array($rm['row'])) foreach ($rm['row'] as $uri){ $url_regex=($uri['vhost'] == ''?$settings['reverse_external_fqdn']:$uri['vhost']); $conf .= "acl {$rm['name']} url_regex -i {$url_regex}/{$uri['uri']}.*$\n"; @@ -156,6 +160,7 @@ function squid_resync_reverse() { $cache_peer_deny_conf .= "cache_peer_access {$map_peer} deny allsrc\n"; } } + } } //ACCESS diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 1da960e0..366ee297 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1007,10 +1007,10 @@ It combines squid as a proxy server with it's capabilities of acting as a HTTP / HTTPS reverse proxy.
It includes an Exchange-Web-Access (OWA) Assistant.]]>
- http://forum.pfsense.org/index.php/topic,44735.0.html + http://forum.pfsense.org/index.php/topic,48347.0.html http://www.squid-cache.org/ Network - 3.1.19 pkg 2.0 + 3.1.19 pkg 2.0.1 RC1 2.0 marcellocoutinho@gmail.com fernando@netfilter.com.br seth.mos@dds.nl mfuchs77@googlemail.com jimp@pfsense.org diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index da29d1b1..a7e149e2 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -115,10 +115,10 @@ It combines squid as a proxy server with it's capabilities of acting as a HTTP / HTTPS reverse proxy.
It includes an Exchange-Web-Access (OWA) Assistant.]]>
- http://forum.pfsense.org/index.php/topic,44735.0.html + http://forum.pfsense.org/index.php/topic,48347.0.html http://www.squid-cache.org/ Network - 3.1.19_2 + 3.1.19 pkg 2.0.1 Stable 2.0 fernando@netfilter.com.br seth.mos@dds.nl mfuchs77@googlemail.com jimp@pfsense.org -- cgit v1.2.3