]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
geoip-block.cgi: Finish column after last element and uneven amount of items.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 12 May 2015 18:39:44 +0000 (20:39 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 12 May 2015 18:39:44 +0000 (20:39 +0200)
html/cgi-bin/geoip-block.cgi

index ccbfa926a0ad3c576217107f0fbc7842edf1cfc4..056b333e8c955eee667a982c2b227804c75c2d0b 100644 (file)
@@ -225,7 +225,16 @@ foreach my $location (@locations) {
        print "<td align='center' $col>$flag</td>\n";
        print "<td align='center' $col>$ccode_uc</td>\n";
        print "<td align='left' $col>$cname</td>$line_end\n";
-                       
+
+       # Finish column when the last element in the array has passed and we have an uneven amount of items.
+       if(! ($lines2 % 2) && ($location eq $locations[-1] )) {
+               print "<td $col>&nbsp;</td>\n";
+               print "<td $col>&nbsp;</td>\n";
+               print "<td $col>&nbsp;</td>\n";
+               print "<td $col>&nbsp;</td>\n";
+               print "<td $col>&nbsp;</td></tr>\n";
+       }
+
 $lines2++;
 }