comparison src/main/java/app/bbs/NetworkJungleBulletinBoard.java @ 175:ac7d1070f449

sanitizing
author tatsuki
date Wed, 30 Jul 2014 22:17:23 +0900
parents e30880a72909
children 6f104ab4eb81
comparison
equal deleted inserted replaced
174:066f58e93a14 175:ac7d1070f449
454 for (int count = 0; _path.substring(count, count + 1) != null; count++) { 454 for (int count = 0; _path.substring(count, count + 1) != null; count++) {
455 if (!_path.substring(count, count + 1).equals("/")) 455 if (!_path.substring(count, count + 1).equals("/"))
456 path = path.add(Integer.parseInt(_path.substring(count, count + 1))); 456 path = path.add(Integer.parseInt(_path.substring(count, count + 1)));
457 } 457 }
458 } catch (Exception _e) { 458 } catch (Exception _e) {
459 System.out.println("屑");
459 } 460 }
460 461
461 JungleTreeEditor editor = tree.getTreeEditor(); 462 JungleTreeEditor editor = tree.getTreeEditor();
462 NodeEditor e = new NodeEditor() { 463 NodeEditor e = new NodeEditor() {
463 public <T extends EditableNode<T>> Either<Error, T> edit(T _e) { 464 public <T extends EditableNode<T>> Either<Error, T> edit(T _e) {
629 public String getUUID() { 630 public String getUUID() {
630 return uuid; 631 return uuid;
631 } 632 }
632 633
633 } 634 }
635
636 public String sanitize( String str ) {
637 if(str==null) {
638 return str;
639 }
640 str = str.replaceAll("&" , "&amp;" );
641 str = str.replaceAll("<" , "&lt;" );
642 str = str.replaceAll(">" , "&gt;" );
643 str = str.replaceAll("\"", "&quot;");
644 str = str.replaceAll("'" , "&#39;" );
645 return str;
646 }
634 647
635 648
636 } 649 }