about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--sourcecodes/create_tiers_gom_part1.php2
-rw-r--r--sourcecodes/mat_structure.php3
-rw-r--r--sourcecodes/network_layout_evd.php1
-rw-r--r--sourcecodes/network_layout_evd_2.php11
-rw-r--r--sourcecodes/network_layout_inv.php1
-rw-r--r--sourcecodes/network_layout_inv_2.php11
-rw-r--r--sourcecodes/remove_variables.php2
-rw-r--r--sourcecodes/runtime_check.php4
8 files changed, 23 insertions, 12 deletions
diff --git a/sourcecodes/create_tiers_gom_part1.php b/sourcecodes/create_tiers_gom_part1.php
index 6b90c015..f2234c28 100644
--- a/sourcecodes/create_tiers_gom_part1.php
+++ b/sourcecodes/create_tiers_gom_part1.php
@@ -64,7 +64,7 @@ if($structure_thr=="")
 
 $nf=$dir.$keyval."nnode.txt";
 $node=trim(file_get_contents("$nf"));
-$maxplist=$node-1;
+$maxplist=(is_numeric($node) ? $node : 0)-1;
 
 //print default number of parents
 $pfile=$dir.$keyval."parent.txt";
diff --git a/sourcecodes/mat_structure.php b/sourcecodes/mat_structure.php
index f4e80290..21d7e709 100644
--- a/sourcecodes/mat_structure.php
+++ b/sourcecodes/mat_structure.php
@@ -65,7 +65,8 @@ for($l=0;$l<=$i;$l++)
 
     for($k=0;$k<$i;$k++)
     {
-       $cell=$data_cell[$k]*$cell_val[$k];
+       $cell_raw=$data_cell[$k] ?? 0;
+       $cell=(is_numeric($cell_raw) ? $cell_raw : 0)*$cell_val[$k];
        fprintf($fp,"%s\t",$cell);
     }
   }
diff --git a/sourcecodes/network_layout_evd.php b/sourcecodes/network_layout_evd.php
index 32e1b7bf..b02d4ce5 100644
--- a/sourcecodes/network_layout_evd.php
+++ b/sourcecodes/network_layout_evd.php
@@ -58,6 +58,7 @@ $datamat=array();
 $data_read=array();
  
 $node=trim($str_arrmat[0]);
+$node=is_numeric($node) ? $node : 0;
 
 $width=150;
 $height=150;
diff --git a/sourcecodes/network_layout_evd_2.php b/sourcecodes/network_layout_evd_2.php
index 7703daab..d6bfa495 100644
--- a/sourcecodes/network_layout_evd_2.php
+++ b/sourcecodes/network_layout_evd_2.php
@@ -102,6 +102,7 @@ $str_arrmat=array();
 $str_arrmat=explode("\n",$matrix1);
 
 $node=trim($str_arrmat[1]);
+$node=is_numeric($node) ? $node : 0;
 
 if($str_arrmat[2]=="" || $matrix1=="")
 {
@@ -199,6 +200,7 @@ $str_arrmat_old=explode("\n",$matrix1_old);
 $datamat_old=array();
 $data_read_old=array();
 $node_old=trim($str_arrmat_old[0]);
+$node_old=is_numeric($node_old) ? $node_old : 0;
 $r_index_old=$node_old+2;
 
 for($i=0;$i<$node_old;$i++)
@@ -282,7 +284,7 @@ foreach($str_arrname as $row)
                 if($j==2)
                    $ID_data[$ii][$k]=$grviz_name_list[$cell];
                 else
-                   $ID_data[$ii][$k]=round($cell/10*900);
+                   $ID_data[$ii][$k]=round((is_numeric($cell) ? $cell : 0)/10*900);
                 $k++; 
              }
        } 
@@ -349,15 +351,16 @@ foreach($str_arrname as $row)
              else if($j==4 && $flag==1)
              {
                   $edge_data[$ii][4]=$cell;
-                  $number_of_point=$cell*2;
+                  $number_of_point=(is_numeric($cell) ? $cell : 0)*2;
                   $index=5;
              }
              else if($j>4 && $number_of_point>0 && $flag==1)
              {
+                $cell_num=is_numeric($cell) ? $cell : 0;
                 if(($j%2)!=0)
-                  $edge_data[$ii][$index]=round($cell/10*900)+60;
+                  $edge_data[$ii][$index]=round($cell_num/10*900)+60;
                 else
-                  $edge_data[$ii][$index]=round($cell/10*900)+48;
+                  $edge_data[$ii][$index]=round($cell_num/10*900)+48;
                 $number_of_point--;
                 $index++;
              }
diff --git a/sourcecodes/network_layout_inv.php b/sourcecodes/network_layout_inv.php
index d457212e..4b0be904 100644
--- a/sourcecodes/network_layout_inv.php
+++ b/sourcecodes/network_layout_inv.php
@@ -53,6 +53,7 @@ $datamat=array();
 $data_read=array();
  
 $node=trim($str_arrmat[0]);
+$node=is_numeric($node) ? $node : 0;
 $width=150;
 $height=150;
 $font=12;
diff --git a/sourcecodes/network_layout_inv_2.php b/sourcecodes/network_layout_inv_2.php
index e6e9b128..cedb3782 100644
--- a/sourcecodes/network_layout_inv_2.php
+++ b/sourcecodes/network_layout_inv_2.php
@@ -191,6 +191,7 @@ exit;
 }
 
 $node=trim($str_arrmat[1]);
+$node=is_numeric($node) ? $node : 0;
 
 
 
@@ -314,6 +315,7 @@ $str_arrmat_old=explode("\n",$matrix1_old);
 $datamat_old=array();
 $data_read_old=array();
 $node_old=trim($str_arrmat_old[0]);
+$node_old=is_numeric($node_old) ? $node_old : 0;
 $r_index_old=$node_old+2;
 
 for($i=0;$i<$node_old;$i++)
@@ -410,7 +412,7 @@ foreach($str_arrname as $row)
                 if($j==2)
                    $ID_data[$ii][$k]=$grviz_name_list[$cell];
                 else
-                   $ID_data[$ii][$k]=round($cell/10*900);
+                   $ID_data[$ii][$k]=round((is_numeric($cell) ? $cell : 0)/10*900);
                // echo $ID_data[$ii][$k];
                 //echo '&nbsp';
 
@@ -491,15 +493,16 @@ foreach($str_arrname as $row)
              else if($j==4 && $flag==1)
              {
                   $edge_data[$ii][4]=$cell;
-                  $number_of_point=$cell*2;
+                  $number_of_point=(is_numeric($cell) ? $cell : 0)*2;
                   $index=5;
              }
              else if($j>4 && $number_of_point>0 && $flag==1)
              {
+                $cell_num=is_numeric($cell) ? $cell : 0;
                 if(($j%2)!=0)
-                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                  $edge_data[$ii][$index]=round($cell_num/10*900)+60;//+30+30;
                 else
-                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+                  $edge_data[$ii][$index]=round($cell_num/10*900)+48;//+18+30;
 
                 $number_of_point--;
                 $index++;
diff --git a/sourcecodes/remove_variables.php b/sourcecodes/remove_variables.php
index 0d925050..04d2ce9a 100644
--- a/sourcecodes/remove_variables.php
+++ b/sourcecodes/remove_variables.php
@@ -64,7 +64,7 @@ if($structure_thr=="")
 
 $nf=$dir.$keyval."nnode.txt";
 $node=trim(file_get_contents("$nf"));
-$maxplist=$node-1;
+$maxplist=(is_numeric($node) ? $node : 0)-1;
 
 //print default number of parents
 $pfile=$dir.$keyval."parent.txt";
diff --git a/sourcecodes/runtime_check.php b/sourcecodes/runtime_check.php
index 7b468957..35c62317 100644
--- a/sourcecodes/runtime_check.php
+++ b/sourcecodes/runtime_check.php
@@ -9,9 +9,11 @@ function exe_time($keyval,$parent_number,$k_number)
 
 $nrf = $dir.$keyval."nrows.txt";
 $nrows=trim(file_get_contents("$nrf"));
+$nrows=is_numeric($nrows) ? $nrows : 0;
 
 $nf=$dir.$keyval."nnode.txt";
-$node=trim(file_get_contents("$nf"))-1;
+$node=trim(file_get_contents("$nf"));
+$node=(is_numeric($node) ? $node : 0)-1;
 $parent_number=$parent_number-1;
 if($parent_number>$node)
 {