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

(legacy) fix var checks

parent d63f538f
...@@ -293,14 +293,14 @@ function ipsec_dump_spd() ...@@ -293,14 +293,14 @@ function ipsec_dump_spd()
if ($line == "No SPD entries.") if ($line == "No SPD entries.")
break; break;
if ($line[0] != "\t") { if ($line[0] != "\t") {
if (is_array($cursp)) if (isset($cursp))
$spd[] = $cursp; $spd[] = $cursp;
$cursp = array(); $cursp = array();
$linea = explode(" ", $line); $linea = explode(" ", $line);
$cursp['srcid'] = substr($linea[0], 0, strpos($linea[0], "[")); $cursp['srcid'] = substr($linea[0], 0, strpos($linea[0], "["));
$cursp['dstid'] = substr($linea[1], 0, strpos($linea[1], "[")); $cursp['dstid'] = substr($linea[1], 0, strpos($linea[1], "["));
$i = 0; $i = 0;
} else if (is_array($cursp)) { } else if (isset($cursp)) {
$linea = explode(" ", trim($line)); $linea = explode(" ", trim($line));
switch($i) switch($i)
{ {
...@@ -320,7 +320,7 @@ function ipsec_dump_spd() ...@@ -320,7 +320,7 @@ function ipsec_dump_spd()
} }
$i++; $i++;
} }
if (is_array($cursp) && count($cursp)) if (isset($cursp) && count($cursp))
$spd[] = $cursp; $spd[] = $cursp;
pclose($fd); 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