public String filter ( final String input ) { reset ( ) ; String s = input ; debug ( "************************************************" ) ; debug ( " INPUT: " + input ) ; s = escapeComments ( s ) ; debug ( " escapeComments: " + s ) ; s = balanceHTML ( s ) ; debug ( " balanceHTML: " + s ) ; s = checkTags ( s ) ; debug ( " checkTags: " + s ) ; s = processRemoveBlanks ( s ) ; debug ( "processRemoveBlanks: " + s ) ; s = validateEntities ( s ) ; debug ( " validateEntites: " + s ) ; debug ( "************************************************\n\n" ) ; return s ; }
given a user submitted input String filter out any invalid or restricted html .