All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.javaclub.sword.security.impl.SqlInjection Maven / Gradle / Ivy

The newest version!
package com.github.javaclub.sword.security.impl;

import com.github.javaclub.sword.core.Strings;
import com.github.javaclub.sword.security.Istrip;

/**
 * 防SQL注入攻击
 */
public class SqlInjection implements Istrip {

	/**
	 * SQL注入内容剥离
	 */
	public String strip(String value) {
		//剥离SQL注入部分代码
		return value.replaceAll("('.+--)|(--)|(\\|)|(%7C)", Strings.EMPTY_STRING);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy