Updated roagen.php - aligned test better

This commit is contained in:
netravnen 2018-12-14 17:29:19 +00:00
parent ebc4055b81
commit f355060e9a

View file

@ -82,10 +82,10 @@ foreach ($files6 as $file)
{
$str = trim_special_chars ($str);
if (startsWith ($str, ("max"), 3)) $raw_array[$i]["max"] = $str;
elseif (startsWith ($str, ("source"), 6)) $raw_array[$i]["source"] = $str;
elseif (startsWith ($str, ("route"), 5)) $raw_array[$i]["route"] = $str;
elseif (startsWith ($str, ("origin"), 6)) $raw_array[$i]["asn"][$j++] = $str;
if (startsWith ($str, "max", 3)) $raw_array[$i]["max"] = $str;
elseif (startsWith ($str, "source", 6)) $raw_array[$i]["source"] = $str;
elseif (startsWith ($str, "route", 5)) $raw_array[$i]["route"] = $str;
elseif (startsWith ($str, "origin", 6)) $raw_array[$i]["asn"][$j++] = $str;
// Catch max-length not set in route object.
if (empty ($raw_array[$i]["max"])) $raw_array[$i]["max"] = -1;
@ -120,6 +120,7 @@ foreach ($raw_array as $sub_array)
// Store extracted values
$_prefix = $prefix[0];
$_ta = (isset ($source[0]) ? $source[0] : "");
// We need to do conditional setting of maxLength to avoid errornous output.
if (($sub_array["max"]) != -1)
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
@ -173,10 +174,10 @@ foreach ($files4 as $file)
{
$str = trim_special_chars ($str);
if (startsWith ($str, ("max"), 3)) $raw_array[$i]["max"] = $str;
elseif (startsWith ($str, ("source"), 6)) $raw_array[$i]["source"] = $str;
elseif (startsWith ($str, ("route"), 5)) $raw_array[$i]["route"] = $str;
elseif (startsWith ($str, ("origin"), 6)) $raw_array[$i]["asn"][$j++] = $str;
if (startsWith ($str, "max", 3)) $raw_array[$i]["max"] = $str;
elseif (startsWith ($str, "source", 6)) $raw_array[$i]["source"] = $str;
elseif (startsWith ($str, "route", 5)) $raw_array[$i]["route"] = $str;
elseif (startsWith ($str, "origin", 6)) $raw_array[$i]["asn"][$j++] = $str;
// Catch max-length not set in route object.
if (empty ($raw_array[$i]["max"])) $raw_array[$i]["max"] = -1;
@ -209,6 +210,7 @@ foreach ($raw_array as $sub_array)
// Store extracted values
$_prefix = $prefix[0];
$_ta = (isset ($source[0]) ? $source[0] : "");
// We need to do conditional setting of maxLength to avoid errornous output.
if (($sub_array["max"]) != -1)
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");