java防止sql注入
程序员文章站
2022-05-26 08:09:10
...
public final static String filterSQLInjection(String s) { if (s == null || "".equals(s)) { return ""; } try { s = s.trim().replaceAll("?[s,S][c,C][r,R][i,I][p,P][t,T]>?", "");//script s = s.trim().replaceAll("[a,A][l,L][e,E][r,R][t,T]\\(", "").replace("\"", "");// alert s = s.trim().replace("\\.swf", "").replaceAll("\\.htc", ""); s = s.trim().replace("\\.php\\b", "").replaceAll("\\.asp\\b", ""); s = s.trim().replace("document\\.", "").replaceAll("[e,E][v,V][a,A][l,L]\\(", ""); s = s.trim().replaceAll("'", "").replaceAll(">", ""); s = s.trim().replaceAll("
上一篇: 关于codeigniter的索引结构