From 9261f5dc7afe273d4b149cf028e14c8eaecf3a93 Mon Sep 17 00:00:00 2001 From: "D. V. Serg" Date: Fri, 22 Feb 2008 08:21:44 +0000 Subject: Rew fix --- packages/squidGuard/squidguard_configurator.inc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'packages') diff --git a/packages/squidGuard/squidguard_configurator.inc b/packages/squidGuard/squidguard_configurator.inc index e2f4981d..b589c42c 100644 --- a/packages/squidGuard/squidguard_configurator.inc +++ b/packages/squidGuard/squidguard_configurator.inc @@ -986,19 +986,23 @@ function sg_build_config() { if ($squidguard_config[FLD_REWRITES]) { sg_addlog("sg_build_config: add rewrites."); $log_entr_added = ''; + $log_entr_err = ''; foreach($squidguard_config[FLD_REWRITES][FLD_ITEM] as $rew) { - $sgconf[] = ""; - $sgconf[] = "rew " . $rew[FLD_NAME] . " {"; - foreach ($rew[FLD_ITEM] as $rw) + if (is_array($rew[FLD_ITEM])) { + $sgconf[] = ""; + $sgconf[] = "rew " . $rew[FLD_NAME] . " {"; + foreach ($rew[FLD_ITEM] as $rw) $sgconf[] = "\t s@." . $rw[FLD_TARGETURL] . "@" . $rw[FLD_REPLACETO]."@r"; - if ($rew[FLD_LOG]) - $sgconf[] = "\t log " . SQUIDGUARD_ACCESSBLOCK_FILE; - $sgconf[] = "}"; - $log_entr_added .= " {$rew[FLD_NAME]};"; + if ($rew[FLD_LOG]) + $sgconf[] = "\t log " . SQUIDGUARD_ACCESSBLOCK_FILE; + $sgconf[] = "}"; + $log_entr_added .= " {$rew[FLD_NAME]};"; + } else + $log_entr_err .= " {$rew[FLD_NAME]};"; } // log if (!empty($log_entr_added)) - sg_addlog("sg_build_config: added: \n $log_entr_added \n"); + sg_addlog("sg_build_config: added: \n $log_entr_added \n error: \n $log_entr_err "); else sg_addlog("sg_build_config: added: Nothing."); } -- cgit v1.2.3