gov.nasa.pds.search.util.XssUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of registry Show documentation
Show all versions of registry Show documentation
The Registry provides provides the PDS-specific search protocol and the search capability for the PDS search index generated through the Search Core software. The core functionality for this service is satisfied by Apache Solr.
The newest version!
package gov.nasa.pds.search.util;
import java.net.URLDecoder;
import java.util.regex.Pattern;
public class XssUtils {
private XssUtils() {
}
// Patterns for Cross-Site Scripting filter.
private static Pattern[] xssPatterns = new Pattern[] {
// script fragments
Pattern.compile("", Pattern.CASE_INSENSITIVE),
// src='...'
Pattern.compile("src[\r\n]*=[\r\n]*\\\'(.*?)\\\'",
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL),
Pattern.compile("src[\r\n]*=[\r\n]*\\\"(.*?)\\\"",
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL),
// lonely script tags
Pattern.compile("", Pattern.CASE_INSENSITIVE),
Pattern.compile("