Changeset cee45e3
- Timestamp:
- May 31, 2018 8:33:31 PM (3 years ago)
- Branches:
- master
- Children:
- 7713284
- Parents:
- 24a1cf71
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/susidns/src/java/src/i2p/susi/dns/AddressBean.java
r24a1cf71 rcee45e3 34 34 import net.i2p.data.Base64; 35 35 import net.i2p.data.Certificate; 36 import net.i2p.data.DataHelper; 36 37 37 38 public class AddressBean … … 210 211 /** @since 0.8.7 */ 211 212 public String getNotes() { 212 return getProp("notes");213 return DataHelper.escapeHTML(getProp("notes")); 213 214 } 214 215 -
apps/susidns/src/java/src/i2p/susi/dns/NamingServiceBean.java
r24a1cf71 rcee45e3 49 49 private static final String DEFAULT_NS = "BlockfileNamingService"; 50 50 private String detail; 51 private String notes; 51 52 52 53 private boolean isDirect() { … … 360 361 } 361 362 363 /** 364 * @since 0.9.35 365 */ 366 public void saveNotes() { 367 if (action == null || !action.equals(_t("Save Notes")) || 368 destination == null || detail == null || isDirect() || 369 notes == null || 370 serial == null || !serial.equals(lastSerial)) 371 return; 372 Properties nsOptions = new Properties(); 373 List<Properties> propsList = new ArrayList<Properties>(4); 374 nsOptions.setProperty("list", getFileName()); 375 List<Destination> dests = getNamingService().lookupAll(detail, nsOptions, propsList); 376 if (dests == null) 377 return; 378 for (int i = 0; i < dests.size(); i++) { 379 if (!dests.get(i).toBase64().equals(destination)) 380 continue; 381 Properties props = propsList.get(i); 382 byte[] nbytes = DataHelper.getUTF8(notes); 383 if (nbytes.length > 255) { 384 // violently truncate, possibly splitting a char 385 byte[] newbytes = new byte[255]; 386 System.arraycopy(nbytes, 0, newbytes, 0, 255); 387 notes = DataHelper.getUTF8(newbytes); 388 // drop replacement char or split pair 389 int last = notes.length() - 1; 390 char lastc = notes.charAt(last); 391 if (lastc == (char) 0xfffd || Character.isHighSurrogate(lastc)) 392 notes = notes.substring(0, last); 393 } 394 props.setProperty("notes", notes); 395 props.setProperty("list", getFileName()); 396 String now = Long.toString(_context.clock().now()); 397 props.setProperty("m", now); 398 if (dests.size() > 1) { 399 // we don't have any API to update properties on a single dest 400 // so remove and re-add 401 getNamingService().remove(detail, dests.get(i), nsOptions); 402 getNamingService().addDestination(detail, dests.get(i), props); 403 } else { 404 getNamingService().put(detail, dests.get(i), props); 405 } 406 return; 407 } 408 } 409 362 410 public void setH(String h) { 363 411 this.detail = DataHelper.stripHTML(h); 412 } 413 414 /** 415 * @since 0.9.35 416 */ 417 public void setNofilter_notes(String n) { 418 notes = n; 364 419 } 365 420 -
apps/susidns/src/jsp/details.jsp
r24a1cf71 rcee45e3 74 74 %><p>No host specified</p><% 75 75 } else { 76 // process save notes form 77 book.saveNotes(); 76 78 detail = net.i2p.data.DataHelper.stripHTML(detail); 77 79 java.util.List<i2p.susi.dns.AddressBean> addrs = book.getLookupAll(); … … 86 88 %> 87 89 <jsp:setProperty name="book" property="trClass" value="0" /> 90 <form method="POST" action="details"> 91 <input type="hidden" name="book" value="${book.book}"> 92 <input type="hidden" name="serial" value="<%=nonce%>"> 93 <input type="hidden" name="h" value="<%=detail%>"> 94 <input type="hidden" name="destination" value="<%=addr.getDestination()%>"> 88 95 <table class="book" id="host_details" cellspacing="0" cellpadding="5"> 89 96 <tr class="list${book.trClass}"> … … 142 149 </tr> 143 150 <tr class="list${book.trClass}"> 144 <td><%=intl._t("Notes")%></td>145 <td><%=addr.getNotes()%></td>146 </tr>147 <tr class="list${book.trClass}">148 151 <td><%=intl._t("Destination")%></td> 149 152 <td class="destinations"><div class="destaddress" tabindex="0"><%=addr.getDestination()%></div></td> 150 153 </tr> 154 <tr class="list${book.trClass}"> 155 <td><%=intl._t("Notes")%><br> 156 <input class="accept" type="submit" name="action" value="<%=intl._t("Save Notes")%>"></td> 157 <td><textarea name="nofilter_notes" rows="3" style="height:6em" wrap="off" cols="70"><%=addr.getNotes()%></textarea></td> 158 </tr> 151 159 </table> 160 </form> 152 161 <div id="buttons"> 153 162 <form method="POST" action="addressbook"> -
history.txt
r24a1cf71 rcee45e3 1 2018-05-31 zzz 2 * Console: 3 - Fix CSS preventing ordered lists (ticket #2075) 4 - Change Java 10 warning to Java 11, 5 * SusiDNS: Add notes form (ticket #1433) 6 7 2018-05-30 zzz 8 * Debian build fixes, remove things from source package 9 * NTCP: Cleanup, prep for NTCP2, increase max RI size 10 * SusiMail: 11 - Button and CSS fixes 12 - Don't require confirmation to delete from Trash, 13 - Clear reallydelete flag when clicking cancel or change folder 14 - Fix dup ConnectWaiter run, lack of failure message 15 - Fix persistent loading/fetching/refresh messages 16 1 17 2018-05-28 zzz 18 * Console: Tagged string fixes (ticket #2017) 2 19 * SusiMail: (ticket #2087) 3 20 - Send deletions after connect so emails don't come back after a move -
router/java/src/net/i2p/router/RouterVersion.java
r24a1cf71 rcee45e3 19 19 public final static String ID = "Monotone"; 20 20 public final static String VERSION = CoreVersion.VERSION; 21 public final static long BUILD = 1 5;21 public final static long BUILD = 16; 22 22 23 23 /** for example "-test" */
Note: See TracChangeset
for help on using the changeset viewer.