From 281534b0b0ec0c92bd9aac8c7d8bced2bdc6b56e Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 11 Jul 2017 02:15:17 +0000 Subject: [PATCH] Fix HTML tags across non-default conditional branches --- .../org/klomp/snark/web/I2PSnarkServlet.java | 6 +++- .../i2ptunnel/I2PTunnelHTTPClientBase.java | 5 ++- history.txt | 1 + router/java/src/net/i2p/router/Blocklist.java | 31 +++++++++++-------- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java index 56461f20e4..56c95d7d7f 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -3506,6 +3506,8 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); } buf.append("\n"); + } else { + buf.append(""); } if (esc) { buf.append(""); @@ -3599,9 +3601,11 @@ public class I2PSnarkServlet extends BasicServlet { buf.append(""); ccount++; + } else { + buf.append(""); // insert empty named columns to maintain table layout } } else { - buf.append(""); // insert empty named columns to maintain table layout .. fails to catch uncommented row when comments also shown + buf.append(""); // insert empty named columns to maintain table layout } buf.append("\n"); } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java index 04da4c8887..213874efe3 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java @@ -757,9 +757,12 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem out.write(_t("{0} jump service", jumphost)); out.write("\n"); } + if (!first) { // We wrote out the opening
+ out.write("
\n"); + } } } - out.write("\n\n"); + out.write("\n"); writeFooter(out); } diff --git a/history.txt b/history.txt index bf1087f9f1..6e61546326 100644 --- a/history.txt +++ b/history.txt @@ -1,5 +1,6 @@ 2017-07-11 str4d * I2PSnark: Fix I2PSnarkUtil.getCommentsName() to match its JavaDoc + * Fix HTML tags across non-default conditional branches 2017-07-08 zzz * GeoIP, blocklist, translations update diff --git a/router/java/src/net/i2p/router/Blocklist.java b/router/java/src/net/i2p/router/Blocklist.java index 38a5b79399..6496da3b90 100644 --- a/router/java/src/net/i2p/router/Blocklist.java +++ b/router/java/src/net/i2p/router/Blocklist.java @@ -1014,13 +1014,13 @@ public class Blocklist { public void renderStatusHTML(Writer out) throws IOException { // move to the jsp //out.write("

Banned IPs

"); + out.write(""); } + out.write("
"); + out.write(""); Set singles = new TreeSet(); singles.addAll(_singleIPBlocklist); if (!(singles.isEmpty() && _singleIPv6Blocklist.isEmpty())) { - out.write("
"); + out.write(_t("IPs Banned Until Restart")); + out.write("
"); } + out.write("
"); - out.write(""); if (!singles.isEmpty()) { out.write("\n"); } } - out.write("
"); - out.write(_t("IPs Banned Until Restart")); - out.write("
"); out.write(_t("IPv4 Addresses")); @@ -1060,13 +1060,18 @@ public class Blocklist { out.write("
"); + } else { + out.write("
"); + out.write(_t("none")); + out.write("
"); + out.write("
"); + out.write(""); if (_blocklistSize > 0) { - out.write("
"); + out.write(_t("IPs Permanently Banned")); + out.write("
"); - out.write(""); - out.write("
"); - out.write(_t("IPs Permanently Banned")); - out.write("
"); + out.write("
"); out.write(_t("From")); out.write(""); out.write(_t("To")); @@ -1110,13 +1115,13 @@ public class Blocklist { // very rare, don't bother translating out.write("
First " + MAX_DISPLAY + " displayed, see the " + BLOCKLIST_FILE_DEFAULT + " file for the full list
"); - out.write("
"); } else { - out.write("
"); + out.write("
"); out.write(_t("none")); - out.write(""); + out.write("
"); + out.write(""); out.flush(); }