1 64 65 package com.jcorporate.expresso.core.db; 66 67 import com.jcorporate.expresso.core.security.filters.Filter; 68 69 75 76 public class MySQLEscapeHandler implements EscapeHandler { 77 transient private static Filter fieldFilter = null; 78 79 public MySQLEscapeHandler() { 80 init(); 81 } 82 83 synchronized private void init() { 84 if (fieldFilter == null) { 85 86 fieldFilter = new Filter(new String []{"'", "\\", "{"}, 90 new String []{"''", "\\\\", "\\{"}); 91 } 92 } 93 94 public String escapeString(String input) { 95 return fieldFilter.standardFilter(input); 96 } 97 } | Popular Tags |