aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-04-24 17:48:07 -0300
committermarcelloc <marcellocoutinho@gmail.com>2012-04-24 17:48:07 -0300
commit854f9b30fe1a3bf592dd28f2127a345f025a00c5 (patch)
tree4cdc4a1270919f5602bfb08d1f26880d747a3b24 /config
parent37eea4a76d4e085209ae37d8ab04c46b720bd3d1 (diff)
downloadpfsense-packages-854f9b30fe1a3bf592dd28f2127a345f025a00c5.tar.gz
pfsense-packages-854f9b30fe1a3bf592dd28f2127a345f025a00c5.tar.bz2
pfsense-packages-854f9b30fe1a3bf592dd28f2127a345f025a00c5.zip
varnish - include array checks to avoid bootup php errors
Diffstat (limited to 'config')
-rw-r--r--config/varnish3/varnish.inc5
-rw-r--r--config/varnish64/varnish.inc5
2 files changed, 6 insertions, 4 deletions
diff --git a/config/varnish3/varnish.inc b/config/varnish3/varnish.inc
index 91d09413..9e78d41f 100644
--- a/config/varnish3/varnish.inc
+++ b/config/varnish3/varnish.inc
@@ -378,7 +378,7 @@ EOFA;
function sync_package_varnish() {
global $config, $g;
- if($config['installedpackages']['varnishcustomvcl']['config'] != "") {
+ if(is_array($config['installedpackages']['varnishcustomvcl']['config'])) {
foreach($config['installedpackages']['varnishcustomvcl']['config'] as $vcl) {
if($vcl['vcl_recv_early'])
$vcl_recv_early = text_area_decode($vcl['vcl_recv_early']);
@@ -397,7 +397,8 @@ function sync_package_varnish() {
$vcl_recv_set_basic='#BASIC VCL RULES SETTING'."\n";
$vcl_recv_action_basic='#BASIC VCL RULES ACTIONS'."\n";
#$plataform=posix_uname();
- foreach($config['installedpackages']['varnishsettings']['config'] as $vcl) {
+ if (is_array($config['installedpackages']['varnishsettings']['config']))
+ foreach($config['installedpackages']['varnishsettings']['config'] as $vcl) {
if($vcl['streaming']){
$vcl_fetch_stream="set beresp.do_stream = true;\n";
}
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc
index 6e552a4f..a7009c7d 100644
--- a/config/varnish64/varnish.inc
+++ b/config/varnish64/varnish.inc
@@ -378,7 +378,7 @@ EOFA;
function sync_package_varnish() {
global $config, $g;
- if($config['installedpackages']['varnishcustomvcl']['config'] != "") {
+ if(is_array($config['installedpackages']['varnishcustomvcl']['config'])) {
foreach($config['installedpackages']['varnishcustomvcl']['config'] as $vcl) {
if($vcl['vcl_recv_early'])
$vcl_recv_early = text_area_decode($vcl['vcl_recv_early']);
@@ -397,7 +397,8 @@ function sync_package_varnish() {
$vcl_recv_set_basic='#BASIC VCL RULES SETTING'."\n";
$vcl_recv_action_basic='#BASIC VCL RULES ACTIONS'."\n";
#$plataform=posix_uname();
- foreach($config['installedpackages']['varnishsettings']['config'] as $vcl) {
+ if (is_array($config['installedpackages']['varnishsettings']['config']))
+ foreach($config['installedpackages']['varnishsettings']['config'] as $vcl) {
if($vcl['fixgzip']){
$vcl_recv_set_basic.="\t#Fix gzip compression\n";
$vcl_recv_set_basic.="\t".'if (req.http.Accept-Encoding) {'."\n";