Changeset cb34015


Ignore:
Timestamp:
Jun 9, 2014 2:14:01 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
884b285
Parents:
299a44e
Message:
  • i2psnark:
    • Linkify all announce URLs on details page
    • Sanitize announce URLs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r299a44e rcb34015  
    16901690        StringBuilder buf = new StringBuilder(128);
    16911691        String trackerLinkUrl = getTrackerLinkUrl(announce, infohash);
    1692         if (trackerLinkUrl != null)
    1693             buf.append(trackerLinkUrl);
    16941692        if (announce.startsWith("http://"))
    16951693            announce = announce.substring(7);
     
    16971695        if (slsh > 0)
    16981696            announce = announce.substring(0, slsh);
     1697        if (trackerLinkUrl != null)
     1698            buf.append(trackerLinkUrl);
     1699        else
     1700            buf.append("<a href=\"http://").append(announce).append("/\">");
    16991701        if (announce.length() > 67)
    17001702            announce = announce.substring(0, 40) + "&hellip;" + announce.substring(announce.length() - 8);
    17011703        buf.append(announce);
    1702         if (trackerLinkUrl != null)
    1703             buf.append("</a>");
     1704        buf.append("</a>");
    17041705        return buf.toString();
    17051706    }
     
    23252326                String announce = meta.getAnnounce();
    23262327                if (announce != null) {
     2328                    announce = DataHelper.stripHTML(announce);
    23272329                    buf.append("<tr><td>");
    23282330                    String trackerLink = getTrackerLink(announce, snark.getInfoHash());
     
    23472349                            else
    23482350                                more = true;
    2349                             buf.append(getShortTrackerLink(s, snark.getInfoHash()));
     2351                            buf.append(getShortTrackerLink(DataHelper.stripHTML(s), snark.getInfoHash()));
    23502352                        }
    23512353                        buf.append("] ");
Note: See TracChangeset for help on using the changeset viewer.