Ticket #975. Properly initialize variables to avoid caching issues. Also check an array exists before trying to foreach to avoid errors.

This commit is contained in:
Ermal 2010-10-27 20:55:09 +00:00
parent a8200dbfe7
commit f48b620546

View File

@ -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;