[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [exonerator/master] Avoid zero-width space in fingerprints.
commit dbf7778270705796c8c485c713eee2f4bb1d4a38
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Mon Mar 6 14:05:44 2017 +0100
Avoid zero-width space in fingerprints.
Apparently, the zero-width space character causes trouble when copying
and pasting fingerprints. Fortunately, we can let the fingerprint
break anywhere using CSS.
Fixes #17231.
---
src/main/java/org/torproject/exonerator/ExoneraTorServlet.java | 6 +++---
src/main/webapp/css/exonerator.css | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java b/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java
index fe6b853..7a5d18b 100644
--- a/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java
+++ b/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java
@@ -834,10 +834,10 @@ public class ExoneraTorServlet extends HttpServlet {
for (String[] tableRow : tableRows) {
out.print(" <tr>");
for (int i = 0; i < tableRow.length; i++) {
+ String attributes = "";
String content = tableRow[i];
if (i == 2) {
- content = content.substring(0, 20) + "​"
- + content.substring(20, 40);
+ attributes = " class=\"fingerprint\"";
} else if (i == 3 && content == null) {
content = "("
+ rb.getString("technicaldetails.nickname.unknown") + ")";
@@ -850,7 +850,7 @@ public class ExoneraTorServlet extends HttpServlet {
content = rb.getString("technicaldetails.exit.no");
}
}
- out.print(" <td>" + content + "</td>");
+ out.print(" <td" + attributes + ">" + content + "</td>");
}
out.print(" </tr>\n");
}
diff --git a/src/main/webapp/css/exonerator.css b/src/main/webapp/css/exonerator.css
index a94fd54..386d49e 100644
--- a/src/main/webapp/css/exonerator.css
+++ b/src/main/webapp/css/exonerator.css
@@ -25,6 +25,11 @@ body {
margin-bottom: 15px;
}
+.fingerprint {
+ word-break: break-all;
+ word-wrap: break-word;
+}
+
pre {
white-space: pre-wrap;
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits