changeset 329:0e4b2c94b75d misc

Sanitize material info HTML table generation.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 31 Dec 2015 03:04:24 +0200
parents 98c798a843ed
children 27356bea526a
files materials/info.php
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/materials/info.php	Thu Dec 31 03:02:47 2015 +0200
+++ b/materials/info.php	Thu Dec 31 03:04:24 2015 +0200
@@ -203,6 +203,7 @@
     $n = 0;
     foreach ($matDataTable[$setShowMat] as $key => $val)
     {
+      if ($n == 0) echo " <tr>";
       echo "<th>".chentities($matTransNames[$key + 1])."</th><td>";
       if (is_array($val))
       {
@@ -216,9 +217,11 @@
         echo chentities($matTransTable[$key][$val]);
       }
       echo "</td>";
-      if ($n++ >= 2) { echo "</tr>\n<tr>"; $n = 0; }
+      if (++$n >= 3) { echo "</tr>\n"; $n = 0; }
     }
-    echo "</tr>\n</table>\n";
+    if ($n != 0) echo "</tr>\n";
+    echo
+      "</table>\n\n";
     
     //
     // Show alloy combinations table for this material