From f48b6205465cf98bed02b0540e68a536b640f86e Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 27 Oct 2010 20:55:09 +0000 Subject: [PATCH] Ticket #975. Properly initialize variables to avoid caching issues. Also check an array exists before trying to foreach to avoid errors. --- etc/rc.filter_synchronize | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize index 46bd66a3c3..cf221bfe05 100755 --- a/etc/rc.filter_synchronize +++ b/etc/rc.filter_synchronize @@ -49,11 +49,14 @@ require_once("interfaces.inc"); */ function backup_vip_config_section() { global $config; - $new_section = &$config['virtualip']; - foreach($new_section['vip'] as $section) { - if($section['mode'] == "proxyarp" || $section['mode'] == "ipalias") { - unset($section); - } + + if (is_array($config['virtualip']['vip'])) + return; + $temp = array(); + $temp['vip'] = array(); + foreach($config['virtualip']['vip'] as $section) { + if($section['mode'] == "proxyarp" || $section['mode'] == "ipalias") + continue; if($section['advskew'] <> "") { $section_val = intval($section['advskew']); $section_val=$section_val+100;