[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #17231 [Metrics/ExoneraTor]: HTML ​ in middle of fingerprint results in corrupted copy/paste



#17231: HTML ​ in middle of fingerprint results in corrupted copy/paste
--------------------------------+---------------------
 Reporter:  starlight           |          Owner:
     Type:  defect              |         Status:  new
 Priority:  High                |      Milestone:
Component:  Metrics/ExoneraTor  |        Version:
 Severity:  Normal              |     Resolution:
 Keywords:                      |  Actual Points:
Parent ID:                      |         Points:
 Reviewer:                      |        Sponsor:
--------------------------------+---------------------

Comment (by cypherpunks):

 For context, Atlas adopted the zero-width space solution in #12685 but
 moved away from it in #21350. #21459 was solved by simply adjusting the
 styling so I'm not sure if its solution is relevant to this ticket.

 See the inline patch for my proposed solution. This patch allows browsers
 to wrap the fingerprint on any character. Selecting the fingerprint is
 possible by double clicking (or triple clicking when it's wrapped) and
 when copying and pasting the fingerprint it does not contain any spaces.

 {{{
 diff --git
 a/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java
 b/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java
 index fe6b853..fb6d82a 100644
 --- a/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java
 +++ b/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java
 @@ -836,8 +836,7 @@ public class ExoneraTorServlet extends HttpServlet {
        for (int i = 0; i < tableRow.length; i++) {
          String content = tableRow[i];
          if (i == 2) {
 -          content = content.substring(0, 20) + "&#8203;"
 -              + content.substring(20, 40);
 +          content = "<div class=\"fingerprint\"" + content + "</div>";
          } else if (i == 3 && content == null) {
            content = "("
                + rb.getString("technicaldetails.nickname.unknown") + ")";
 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;
  }
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17231#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs