Java Code Examples for org.owasp.encoder.Encode#forJava()

The following examples show how to use org.owasp.encoder.Encode#forJava() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EncodeHostObject.java    From carbon-apimgt with Apache License 2.0 4 votes vote down vote up
public static String jsFunction_forJava(Context cx, Scriptable thisObj, Object[] args, Function funObj)
        throws APIManagementException{
    return Encode.forJava(validateInput(args));
}
 
Example 2
Source File: SanitizedEmailLogRenderer.java    From spring-boot-email-tools with Apache License 2.0 2 votes vote down vote up
/**
 * Sanitize text to prevent injection of EOL characters into log messages.
 * <p>
 * Actually, replaces all whitespaces including CR and LF with a space and all other ASCII control
 * characters with "?" to avoid malicious code in the logs.
 */
private static String sanitizeString(String text) {
    return Encode.forJava(text);
}