Updated roagen.php - aligned test better
This commit is contained in:
parent
ebc4055b81
commit
f355060e9a
18
roagen.php
18
roagen.php
|
@ -82,10 +82,10 @@ foreach ($files6 as $file)
|
||||||
{
|
{
|
||||||
$str = trim_special_chars ($str);
|
$str = trim_special_chars ($str);
|
||||||
|
|
||||||
if (startsWith ($str, ("max"), 3)) $raw_array[$i]["max"] = $str;
|
if (startsWith ($str, "max", 3)) $raw_array[$i]["max"] = $str;
|
||||||
elseif (startsWith ($str, ("source"), 6)) $raw_array[$i]["source"] = $str;
|
elseif (startsWith ($str, "source", 6)) $raw_array[$i]["source"] = $str;
|
||||||
elseif (startsWith ($str, ("route"), 5)) $raw_array[$i]["route"] = $str;
|
elseif (startsWith ($str, "route", 5)) $raw_array[$i]["route"] = $str;
|
||||||
elseif (startsWith ($str, ("origin"), 6)) $raw_array[$i]["asn"][$j++] = $str;
|
elseif (startsWith ($str, "origin", 6)) $raw_array[$i]["asn"][$j++] = $str;
|
||||||
|
|
||||||
// Catch max-length not set in route object.
|
// Catch max-length not set in route object.
|
||||||
if (empty ($raw_array[$i]["max"])) $raw_array[$i]["max"] = -1;
|
if (empty ($raw_array[$i]["max"])) $raw_array[$i]["max"] = -1;
|
||||||
|
@ -120,6 +120,7 @@ foreach ($raw_array as $sub_array)
|
||||||
// Store extracted values
|
// Store extracted values
|
||||||
$_prefix = $prefix[0];
|
$_prefix = $prefix[0];
|
||||||
$_ta = (isset ($source[0]) ? $source[0] : "");
|
$_ta = (isset ($source[0]) ? $source[0] : "");
|
||||||
|
|
||||||
// We need to do conditional setting of maxLength to avoid errornous output.
|
// We need to do conditional setting of maxLength to avoid errornous output.
|
||||||
if (($sub_array["max"]) != -1)
|
if (($sub_array["max"]) != -1)
|
||||||
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
||||||
|
@ -173,10 +174,10 @@ foreach ($files4 as $file)
|
||||||
{
|
{
|
||||||
$str = trim_special_chars ($str);
|
$str = trim_special_chars ($str);
|
||||||
|
|
||||||
if (startsWith ($str, ("max"), 3)) $raw_array[$i]["max"] = $str;
|
if (startsWith ($str, "max", 3)) $raw_array[$i]["max"] = $str;
|
||||||
elseif (startsWith ($str, ("source"), 6)) $raw_array[$i]["source"] = $str;
|
elseif (startsWith ($str, "source", 6)) $raw_array[$i]["source"] = $str;
|
||||||
elseif (startsWith ($str, ("route"), 5)) $raw_array[$i]["route"] = $str;
|
elseif (startsWith ($str, "route", 5)) $raw_array[$i]["route"] = $str;
|
||||||
elseif (startsWith ($str, ("origin"), 6)) $raw_array[$i]["asn"][$j++] = $str;
|
elseif (startsWith ($str, "origin", 6)) $raw_array[$i]["asn"][$j++] = $str;
|
||||||
|
|
||||||
// Catch max-length not set in route object.
|
// Catch max-length not set in route object.
|
||||||
if (empty ($raw_array[$i]["max"])) $raw_array[$i]["max"] = -1;
|
if (empty ($raw_array[$i]["max"])) $raw_array[$i]["max"] = -1;
|
||||||
|
@ -209,6 +210,7 @@ foreach ($raw_array as $sub_array)
|
||||||
// Store extracted values
|
// Store extracted values
|
||||||
$_prefix = $prefix[0];
|
$_prefix = $prefix[0];
|
||||||
$_ta = (isset ($source[0]) ? $source[0] : "");
|
$_ta = (isset ($source[0]) ? $source[0] : "");
|
||||||
|
|
||||||
// We need to do conditional setting of maxLength to avoid errornous output.
|
// We need to do conditional setting of maxLength to avoid errornous output.
|
||||||
if (($sub_array["max"]) != -1)
|
if (($sub_array["max"]) != -1)
|
||||||
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
$_maxlength = (isset ($maxlength[0]) ? $maxlength[0] : "");
|
||||||
|
|
Loading…
Reference in a new issue