Commit 0ffebfad authored by Ad Schellevis's avatar Ad Schellevis

(legacy) fix var checks

parent d63f538f
......@@ -293,14 +293,14 @@ function ipsec_dump_spd()
if ($line == "No SPD entries.")
break;
if ($line[0] != "\t") {
if (is_array($cursp))
if (isset($cursp))
$spd[] = $cursp;
$cursp = array();
$linea = explode(" ", $line);
$cursp['srcid'] = substr($linea[0], 0, strpos($linea[0], "["));
$cursp['dstid'] = substr($linea[1], 0, strpos($linea[1], "["));
$i = 0;
} else if (is_array($cursp)) {
} else if (isset($cursp)) {
$linea = explode(" ", trim($line));
switch($i)
{
......@@ -320,7 +320,7 @@ function ipsec_dump_spd()
}
$i++;
}
if (is_array($cursp) && count($cursp))
if (isset($cursp) && count($cursp))
$spd[] = $cursp;
pclose($fd);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment